/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @signatureAlgorithm = 'v2';
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('iacservice', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model JobStatusDetailValue = {
  comment?: string(name='comment'),
  jobResult?: string(name='jobResult', example='{}'),
  timeStamps?: string(name='timeStamps', example='2022-06-13 17:11:34'),
}

model JobsStatusDetailValue = {
  comment?: string(name='comment', example='""'),
  jobResult?: string(name='jobResult', example='""'),
  timeStamps?: string(name='timeStamps', example='2022-06-13 17:11:34'),
}

model AssociateGroupRequest {
  clientToken?: string(name='clientToken', example='a65451293e64979ba7a4b573950217fe'),
  projectId?: string(name='projectId', example='p-433aead7560571a87349d054b4'),
  resourceIds?: [ string ](name='resourceIds', description='This parameter is required.'),
  resourceType?: string(name='resourceType', example='Task'),
}

model AssociateGroupResponseBody = {
  requestId?: string(name='requestId', example='B6ED9F71-7FA8-598E-B64D-4606FB3FCCC9'),
}

model AssociateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateGroupResponseBody(name='body'),
}

/**
 * @summary 分组关联
 *
 * @param request AssociateGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateGroupResponse
 */
async function associateGroupWithOptions(groupId: string, request: AssociateGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): AssociateGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.projectId)) {
    body['projectId'] = request.projectId;
  }
  if (!$isNull(request.resourceIds)) {
    body['resourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AssociateGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/${$URL.percentEncode(groupId)}/associate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 分组关联
 *
 * @param request AssociateGroupRequest
 * @return AssociateGroupResponse
 */
async function associateGroup(groupId: string, request: AssociateGroupRequest): AssociateGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return associateGroupWithOptions(groupId, request, headers, runtime);
}

model AssociateParameterSetRequest {
  parameterSetIds?: [ string ](name='parameterSetIds', description='This parameter is required.'),
  resourceId?: string(name='resourceId', description='This parameter is required.', example='task-433aead756057ffdf5326bf1e12ed'),
  resourceType?: string(name='resourceType', description='This parameter is required.', example='Task'),
}

model AssociateParameterSetResponseBody = {
  requestId?: string(name='requestId', example='BF75EF50-955D-5E1F-AB23-A657C2C6D3C7'),
}

model AssociateParameterSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateParameterSetResponseBody(name='body'),
}

/**
 * @summary 将参数集关联资源
 *
 * @param request AssociateParameterSetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateParameterSetResponse
 */
async function associateParameterSetWithOptions(request: AssociateParameterSetRequest, headers: map[string]string, runtime: $RuntimeOptions): AssociateParameterSetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.parameterSetIds)) {
    body['parameterSetIds'] = request.parameterSetIds;
  }
  if (!$isNull(request.resourceId)) {
    body['resourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AssociateParameterSet',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets/operations/associate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 将参数集关联资源
 *
 * @param request AssociateParameterSetRequest
 * @return AssociateParameterSetResponse
 */
async function associateParameterSet(request: AssociateParameterSetRequest): AssociateParameterSetResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return associateParameterSetWithOptions(request, headers, runtime);
}

model AttachRabbitmqPublisherRequest {
  taskId?: string(name='taskId', description='This parameter is required.', example='task-518855d9a058cfffcbeafaebe6c89'),
}

model AttachRabbitmqPublisherResponseBody = {
  requestId?: string(name='requestId', example='D1DEAA38-D888-5811-A8A6-E1E2FBC0779C'),
}

model AttachRabbitmqPublisherResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachRabbitmqPublisherResponseBody(name='body'),
}

/**
 * @summary 将消息发布者挂载到任务
 *
 * @param request AttachRabbitmqPublisherRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachRabbitmqPublisherResponse
 */
async function attachRabbitmqPublisherWithOptions(publisherId: string, request: AttachRabbitmqPublisherRequest, headers: map[string]string, runtime: $RuntimeOptions): AttachRabbitmqPublisherResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AttachRabbitmqPublisher',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers/${$URL.percentEncode(publisherId)}/attach`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 将消息发布者挂载到任务
 *
 * @param request AttachRabbitmqPublisherRequest
 * @return AttachRabbitmqPublisherResponse
 */
async function attachRabbitmqPublisher(publisherId: string, request: AttachRabbitmqPublisherRequest): AttachRabbitmqPublisherResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return attachRabbitmqPublisherWithOptions(publisherId, request, headers, runtime);
}

model CancelProjectBuildResponseBody = {
  requestId?: string(name='requestId', example='C7070EC3-DF66-58BA-A1DD-A8574FF53143'),
}

model CancelProjectBuildResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelProjectBuildResponseBody(name='body'),
}

/**
 * @summary 取消执行
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelProjectBuildResponse
 */
async function cancelProjectBuildWithOptions(projectId: string, projectBuildId: string, headers: map[string]string, runtime: $RuntimeOptions): CancelProjectBuildResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelProjectBuild',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}/build/${$URL.percentEncode(projectBuildId)}/cancel`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消执行
 *
 * @return CancelProjectBuildResponse
 */
async function cancelProjectBuild(projectId: string, projectBuildId: string): CancelProjectBuildResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelProjectBuildWithOptions(projectId, projectBuildId, headers, runtime);
}

model CancelRamPolicyExportTaskResponseBody = {
  requestId?: string(name='requestId', example='E2D0E863-1651-5E58-823F-B451C8C24615'),
}

model CancelRamPolicyExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelRamPolicyExportTaskResponseBody(name='body'),
}

/**
 * @summary 取消RAM策略导出任务
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelRamPolicyExportTaskResponse
 */
async function cancelRamPolicyExportTaskWithOptions(ramPolicyExportTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): CancelRamPolicyExportTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelRamPolicyExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}/cancel`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消RAM策略导出任务
 *
 * @return CancelRamPolicyExportTaskResponse
 */
async function cancelRamPolicyExportTask(ramPolicyExportTaskId: string): CancelRamPolicyExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelRamPolicyExportTaskWithOptions(ramPolicyExportTaskId, headers, runtime);
}

model CancelResourceExportTaskRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  ramRole?: string(name='ramRole', example='{}'),
}

model CancelResourceExportTaskResponseBody = {
  exportTaskId?: string(name='exportTaskId', example='ex-3b6cb9fa4751a6e5cdc6460282'),
  exportVersion?: string(name='exportVersion', example='v1'),
  requestId?: string(name='requestId', example='136B3926-DD90-5DB2-96EC-8BAD6407D1C9'),
}

model CancelResourceExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelResourceExportTaskResponseBody(name='body'),
}

/**
 * @summary 取消资源导出任务
 *
 * @param request CancelResourceExportTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelResourceExportTaskResponse
 */
async function cancelResourceExportTaskWithOptions(exportTaskId: string, request: CancelResourceExportTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): CancelResourceExportTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelResourceExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/cancel/${$URL.percentEncode(exportTaskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消资源导出任务
 *
 * @param request CancelResourceExportTaskRequest
 * @return CancelResourceExportTaskResponse
 */
async function cancelResourceExportTask(exportTaskId: string, request: CancelResourceExportTaskRequest): CancelResourceExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return cancelResourceExportTaskWithOptions(exportTaskId, request, headers, runtime);
}

model CheckResourceNameRequest {
  id?: string(name='id', example='mod-433af53ab7cc71afa'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  parentId?: string(name='parentId', example='p-663a72b75245e3'),
  resourceType?: string(name='resourceType', description='This parameter is required.', example='task'),
}

model CheckResourceNameResponseBody = {
  requestId?: string(name='requestId', example='24B9B06B-16D8-5558-9FE1-C29757EB1689'),
  result?: boolean(name='result', example='true'),
}

model CheckResourceNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckResourceNameResponseBody(name='body'),
}

/**
 * @summary 校验资源名称
 *
 * @param request CheckResourceNameRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckResourceNameResponse
 */
async function checkResourceNameWithOptions(request: CheckResourceNameRequest, headers: map[string]string, runtime: $RuntimeOptions): CheckResourceNameResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.id)) {
    query['id'] = request.id;
  }
  if (!$isNull(request.name)) {
    query['name'] = request.name;
  }
  if (!$isNull(request.parentId)) {
    query['parentId'] = request.parentId;
  }
  if (!$isNull(request.resourceType)) {
    query['resourceType'] = request.resourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CheckResourceName',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/check/name`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验资源名称
 *
 * @param request CheckResourceNameRequest
 * @return CheckResourceNameResponse
 */
async function checkResourceName(request: CheckResourceNameRequest): CheckResourceNameResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return checkResourceNameWithOptions(request, headers, runtime);
}

model CloneGroupRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  name?: string(name='name', description='This parameter is required.', example='abc'),
  projectId?: string(name='projectId', example='p-433aead7560571a87349d054b4'),
  resourceTypes?: [ string ](name='resourceTypes'),
}

model CloneGroupResponseBody = {
  requestId?: string(name='requestId', example='BF75EF50-955D-5E1F-AB23-A657C2C6D3C7'),
}

model CloneGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneGroupResponseBody(name='body'),
}

/**
 * @summary 克隆分组
 *
 * @param request CloneGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneGroupResponse
 */
async function cloneGroupWithOptions(groupId: string, request: CloneGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): CloneGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.projectId)) {
    body['projectId'] = request.projectId;
  }
  if (!$isNull(request.resourceTypes)) {
    body['resourceTypes'] = request.resourceTypes;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CloneGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/${$URL.percentEncode(groupId)}/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 克隆分组
 *
 * @param request CloneGroupRequest
 * @return CloneGroupResponse
 */
async function cloneGroup(groupId: string, request: CloneGroupRequest): CloneGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneGroupWithOptions(groupId, request, headers, runtime);
}

model CloneModuleRequest {
  description?: string(name='description', description='This parameter is required.', example='ok'),
  moduleId?: string(name='moduleId', description='This parameter is required.', example='mod-148e7853433574fff6b316f4eb737e'),
  moduleSource?: string(name='moduleSource', description='This parameter is required.', example='market'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.', example='v1'),
  name?: string(name='name', description='This parameter is required.', example='abc'),
}

model CloneModuleResponseBody = {
  moduleId?: string(name='moduleId', example='mod-71012916a5a376f265ebc3774'),
  requestId?: string(name='requestId', example='78EC2EFB-AED9-5C23-AE98-6DDC6F2F96D6'),
}

model CloneModuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneModuleResponseBody(name='body'),
}

/**
 * @summary 克隆模版
 *
 * @param request CloneModuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneModuleResponse
 */
async function cloneModuleWithOptions(request: CloneModuleRequest, headers: map[string]string, runtime: $RuntimeOptions): CloneModuleResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleSource)) {
    body['moduleSource'] = request.moduleSource;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CloneModule',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/operations/clone`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 克隆模版
 *
 * @param request CloneModuleRequest
 * @return CloneModuleResponse
 */
async function cloneModule(request: CloneModuleRequest): CloneModuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneModuleWithOptions(request, headers, runtime);
}

model CreateAuthorizationRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  dueTime?: string(name='dueTime'),
  moduleId?: string(name='moduleId', description='This parameter is required.', example='mod-148e7853433574fff6b316f4eb737e'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.', example='v1'),
  name?: string(name='name', example='test'),
  uid?: long(name='uid', description='This parameter is required.', example='5a220da4-f594-4776-87ed-f37888ec0473'),
}

model CreateAuthorizationResponseBody = {
  authorizationId?: string(name='authorizationId', example='auth-14e80de4866bf7171264a9b40661'),
  requestId?: string(name='requestId', example='5FE84246-BB17-54BF-9F7A-F496270AC6DA'),
}

model CreateAuthorizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAuthorizationResponseBody(name='body'),
}

/**
 * @summary 创建共享
 *
 * @param request CreateAuthorizationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAuthorizationResponse
 */
async function createAuthorizationWithOptions(request: CreateAuthorizationRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateAuthorizationResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.dueTime)) {
    body['dueTime'] = request.dueTime;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.uid)) {
    body['uid'] = request.uid;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAuthorization',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/authorizations`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建共享
 *
 * @param request CreateAuthorizationRequest
 * @return CreateAuthorizationResponse
 */
async function createAuthorization(request: CreateAuthorizationRequest): CreateAuthorizationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createAuthorizationWithOptions(request, headers, runtime);
}

model CreateExplorerTaskRequest {
  initModuleState?: boolean(name='InitModuleState'),
  terraformVersion?: string(name='TerraformVersion'),
  autoApply?: boolean(name='autoApply', description='This parameter is required.'),
  autoDestroy?: boolean(name='autoDestroy'),
  clientToken?: string(name='clientToken', description='This parameter is required.'),
  description?: string(name='description'),
  moduleId?: string(name='moduleId', description='This parameter is required.'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.'),
  skipPropertyValidation?: boolean(name='skipPropertyValidation'),
  terraformProviderVersion?: string(name='terraformProviderVersion'),
  triggerValue?: string(name='triggerValue'),
}

model CreateExplorerTaskResponseBody = {
  explorerTaskId?: string(name='explorerTaskId'),
  requestId?: string(name='requestId'),
}

model CreateExplorerTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExplorerTaskResponseBody(name='body'),
}

/**
 * @summary 创建Explorer任务
 *
 * @param request CreateExplorerTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExplorerTaskResponse
 */
async function createExplorerTaskWithOptions(request: CreateExplorerTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateExplorerTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.initModuleState)) {
    body['InitModuleState'] = request.initModuleState;
  }
  if (!$isNull(request.terraformVersion)) {
    body['TerraformVersion'] = request.terraformVersion;
  }
  if (!$isNull(request.autoApply)) {
    body['autoApply'] = request.autoApply;
  }
  if (!$isNull(request.autoDestroy)) {
    body['autoDestroy'] = request.autoDestroy;
  }
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.initModuleState)) {
    body['initModuleState'] = request.initModuleState;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.skipPropertyValidation)) {
    body['skipPropertyValidation'] = request.skipPropertyValidation;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }
  if (!$isNull(request.triggerValue)) {
    body['triggerValue'] = request.triggerValue;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateExplorerTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/explorerTask`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建Explorer任务
 *
 * @param request CreateExplorerTaskRequest
 * @return CreateExplorerTaskResponse
 */
async function createExplorerTask(request: CreateExplorerTaskRequest): CreateExplorerTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createExplorerTaskWithOptions(request, headers, runtime);
}

model CreateGroupRequest {
  autoDestroy?: boolean(name='autoDestroy', example='true'),
  autoTrigger?: boolean(name='autoTrigger', example='true'),
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  forcedSetting?: boolean(name='forcedSetting', example='true'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  notifyConfig?: [ 
    {
      notifyPath?: string(name='notifyPath', example='/'),
      notifyType?: string(name='notifyType', example='DingDing'),
    }
  ](name='notifyConfig'),
  notifyOperationTypes?: [ string ](name='notifyOperationTypes'),
  projectId?: string(name='projectId', description='This parameter is required.', example='p-433aead7560571a87349d054b4'),
  ramRole?: string(name='ramRole', example='ramName'),
  reportExportField?: [ string ](name='reportExportField'),
  reportExportPath?: string(name='reportExportPath', example='https://test.oss-cn-hangzhou.aliyuncs.com/test/test'),
  terraformProviderVersion?: string(name='terraformProviderVersion', example='1.189.0'),
  triggerConfig?: [ 
    {
      triggerStrategy?: string(name='triggerStrategy', example='Cron'),
      triggerValue?: string(name='triggerValue', example='0 0 19 * * ？'),
    }
  ](name='triggerConfig'),
  triggerResourceType?: [ string ](name='triggerResourceType'),
}

model CreateGroupResponseBody = {
  groupId?: string(name='groupId', example='g-4267dcfbf1b6d128c87adf0e95f'),
  requestId?: string(name='requestId', example='E2D0E863-1651-5E58-823F-B451C8C24615'),
}

model CreateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGroupResponseBody(name='body'),
}

/**
 * @summary 创建分组
 *
 * @param request CreateGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGroupResponse
 */
async function createGroupWithOptions(request: CreateGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoDestroy)) {
    body['autoDestroy'] = request.autoDestroy;
  }
  if (!$isNull(request.autoTrigger)) {
    body['autoTrigger'] = request.autoTrigger;
  }
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.forcedSetting)) {
    body['forcedSetting'] = request.forcedSetting;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.notifyConfig)) {
    body['notifyConfig'] = request.notifyConfig;
  }
  if (!$isNull(request.notifyOperationTypes)) {
    body['notifyOperationTypes'] = request.notifyOperationTypes;
  }
  if (!$isNull(request.projectId)) {
    body['projectId'] = request.projectId;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.reportExportField)) {
    body['reportExportField'] = request.reportExportField;
  }
  if (!$isNull(request.reportExportPath)) {
    body['reportExportPath'] = request.reportExportPath;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }
  if (!$isNull(request.triggerConfig)) {
    body['triggerConfig'] = request.triggerConfig;
  }
  if (!$isNull(request.triggerResourceType)) {
    body['triggerResourceType'] = request.triggerResourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建分组
 *
 * @param request CreateGroupRequest
 * @return CreateGroupResponse
 */
async function createGroup(request: CreateGroupRequest): CreateGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createGroupWithOptions(request, headers, runtime);
}

model CreateJobRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='2daf4227f747cbf11a5501f18cc5e004'),
  description?: string(name='description', description='This parameter is required.', example='test'),
  executeType?: string(name='executeType'),
  subCommand?: string(name='subCommand', example='null'),
  taskType?: string(name='taskType'),
}

model CreateJobResponseBody = {
  jobId?: string(name='jobId', example='job-518855d9a058c32798c319561f'),
  requestId?: string(name='requestId', example='136B3926-DD90-5DB2-96EC-8BAD6407D1C9'),
}

model CreateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateJobResponseBody(name='body'),
}

/**
 * @summary 创建作业
 *
 * @param request CreateJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateJobResponse
 */
async function createJobWithOptions(taskId: string, request: CreateJobRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateJobResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.executeType)) {
    body['executeType'] = request.executeType;
  }
  if (!$isNull(request.subCommand)) {
    body['subCommand'] = request.subCommand;
  }
  if (!$isNull(request.taskType)) {
    body['taskType'] = request.taskType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateJob',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建作业
 *
 * @param request CreateJobRequest
 * @return CreateJobResponse
 */
async function createJob(taskId: string, request: CreateJobRequest): CreateJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createJobWithOptions(taskId, request, headers, runtime);
}

model CreateModuleRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  groupInfo?: {
    groupId?: string(name='groupId', example='g-5fd38c9b92d541a7083a86432e2'),
    projectId?: string(name='projectId', example='p-433aead75605713865c386cb9d'),
  }(name='groupInfo'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  source?: string(name='source', example='OSS'),
  sourcePath?: string(name='sourcePath', example='OSS：
"oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/code.zip"
Registry：
"alibaba/security-group/alicloud:2.1.0"'),
  statePath?: string(name='statePath', example='oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/terraform.tfstate'),
  versionStrategy?: string(name='versionStrategy', example='Manual'),
}

model CreateModuleResponseBody = {
  moduleId?: string(name='moduleId', example='mod-518855d9a058cfffcc446d8fe3c99'),
  requestId?: string(name='requestId', example='0D797DC3-FF04-5C21-81EB-92C7799512E3'),
}

model CreateModuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateModuleResponseBody(name='body'),
}

/**
 * @summary 创建模版
 *
 * @param request CreateModuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateModuleResponse
 */
async function createModuleWithOptions(request: CreateModuleRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateModuleResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.groupInfo)) {
    body['groupInfo'] = request.groupInfo;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.source)) {
    body['source'] = request.source;
  }
  if (!$isNull(request.sourcePath)) {
    body['sourcePath'] = request.sourcePath;
  }
  if (!$isNull(request.statePath)) {
    body['statePath'] = request.statePath;
  }
  if (!$isNull(request.versionStrategy)) {
    body['versionStrategy'] = request.versionStrategy;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateModule',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建模版
 *
 * @param request CreateModuleRequest
 * @return CreateModuleResponse
 */
async function createModule(request: CreateModuleRequest): CreateModuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createModuleWithOptions(request, headers, runtime);
}

model CreateModuleVersionRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  name?: string(name='name', description='This parameter is required.', example='test'),
}

model CreateModuleVersionResponseBody = {
  moduleVersion?: string(name='moduleVersion', example='v1'),
  requestId?: string(name='requestId', example='B6ED9F71-7FA8-598E-B64D-4606FB3FCCC9'),
}

model CreateModuleVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateModuleVersionResponseBody(name='body'),
}

/**
 * @summary 创建模版版本
 *
 * @param request CreateModuleVersionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateModuleVersionResponse
 */
async function createModuleVersionWithOptions(moduleId: string, request: CreateModuleVersionRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateModuleVersionResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateModuleVersion',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/${$URL.percentEncode(moduleId)}/versions`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建模版版本
 *
 * @param request CreateModuleVersionRequest
 * @return CreateModuleVersionResponse
 */
async function createModuleVersion(moduleId: string, request: CreateModuleVersionRequest): CreateModuleVersionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createModuleVersionWithOptions(moduleId, request, headers, runtime);
}

model CreateParameterSetRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  parameters?: [ 
    {
      name?: string(name='name', example='test1121'),
      type?: string(name='type', example='string'),
      value?: string(name='value', example='test'),
    }
  ](name='parameters'),
}

model CreateParameterSetResponseBody = {
  parameterSetId?: string(name='parameterSetId', example='pts-3b6cb9fa4751afff89a4b73779e0d'),
  requestId?: string(name='requestId', example='7FA0FF4A-ABD4-54F6-BEAC-B4273EBA10A2'),
}

model CreateParameterSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateParameterSetResponseBody(name='body'),
}

/**
 * @summary 创建参数集
 *
 * @param request CreateParameterSetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateParameterSetResponse
 */
async function createParameterSetWithOptions(request: CreateParameterSetRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateParameterSetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.parameters)) {
    body['parameters'] = request.parameters;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateParameterSet',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建参数集
 *
 * @param request CreateParameterSetRequest
 * @return CreateParameterSetResponse
 */
async function createParameterSet(request: CreateParameterSetRequest): CreateParameterSetResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createParameterSetWithOptions(request, headers, runtime);
}

model CreateProjectRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  name?: string(name='name', description='This parameter is required.', example='test'),
}

model CreateProjectResponseBody = {
  projectId?: string(name='projectId', example='p-433aead7560572f8d95b25775c'),
  requestId?: string(name='requestId', example='3E49127A-BB65-5CCD-AB93-0EC0A43E5446'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary 创建项目
 *
 * @param request CreateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(request: CreateProjectRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateProjectResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateProject',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建项目
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectWithOptions(request, headers, runtime);
}

model CreateProjectBuildRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  groupId?: string(name='groupId'),
  projectBuildAction?: string(name='projectBuildAction', description='This parameter is required.', example='refresh'),
  taskIds?: [ string ](name='taskIds'),
  taskPolicies?: [ 
    {
      destroyAfterExecution?: boolean(name='destroyAfterExecution', example='destroyAfterExecution'),
      priority?: long(name='priority', example='30'),
      taskId?: string(name='taskId', example='task-60f24b4eb47f1135b7b14ddbdfd'),
    }
  ](name='taskPolicies'),
}

model CreateProjectBuildResponseBody = {
  id?: string(name='id', example='pb-433aead756057193ba8bb410945'),
  requestId?: string(name='requestId', example='EE295EEC-EA85-5899-B2D5-5FCA788AC3C6'),
}

model CreateProjectBuildResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectBuildResponseBody(name='body'),
}

/**
 * @summary 构建项目批次
 *
 * @param request CreateProjectBuildRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectBuildResponse
 */
async function createProjectBuildWithOptions(projectId: string, request: CreateProjectBuildRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateProjectBuildResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.groupId)) {
    body['groupId'] = request.groupId;
  }
  if (!$isNull(request.projectBuildAction)) {
    body['projectBuildAction'] = request.projectBuildAction;
  }
  if (!$isNull(request.taskIds)) {
    body['taskIds'] = request.taskIds;
  }
  if (!$isNull(request.taskPolicies)) {
    body['taskPolicies'] = request.taskPolicies;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateProjectBuild',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}/build`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 构建项目批次
 *
 * @param request CreateProjectBuildRequest
 * @return CreateProjectBuildResponse
 */
async function createProjectBuild(projectId: string, request: CreateProjectBuildRequest): CreateProjectBuildResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectBuildWithOptions(projectId, request, headers, runtime);
}

model CreateRabbitmqPublisherRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='ok'),
  exchangeName?: string(name='exchangeName', description='This parameter is required.', example='ExchangeTest'),
  exchangeType?: string(name='exchangeType', example='TOPIC'),
  hostName?: string(name='hostName', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.', example='MQ'),
  password?: string(name='password', description='This parameter is required.', example='NDAxREVDQzI2MjA0OT****'),
  port?: long(name='port', description='This parameter is required.', example='5672'),
  userName?: string(name='userName', description='This parameter is required.', example='MjoxODgwNzcwODY5MD****'),
  virtualHost?: string(name='virtualHost', description='This parameter is required.', example='Test'),
}

model CreateRabbitmqPublisherResponseBody = {
  publisherId?: string(name='publisherId', example='mqp-3b6cb9fa4751afffb0af06b9ba504'),
  requestId?: string(name='requestId', example='C3DA172D-DDCF-5268-BB0F-060C3A9D2623'),
}

model CreateRabbitmqPublisherResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRabbitmqPublisherResponseBody(name='body'),
}

/**
 * @summary 创建消息发布者
 *
 * @param request CreateRabbitmqPublisherRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRabbitmqPublisherResponse
 */
async function createRabbitmqPublisherWithOptions(request: CreateRabbitmqPublisherRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateRabbitmqPublisherResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.exchangeName)) {
    body['exchangeName'] = request.exchangeName;
  }
  if (!$isNull(request.exchangeType)) {
    body['exchangeType'] = request.exchangeType;
  }
  if (!$isNull(request.hostName)) {
    body['hostName'] = request.hostName;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.password)) {
    body['password'] = request.password;
  }
  if (!$isNull(request.port)) {
    body['port'] = request.port;
  }
  if (!$isNull(request.userName)) {
    body['userName'] = request.userName;
  }
  if (!$isNull(request.virtualHost)) {
    body['virtualHost'] = request.virtualHost;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateRabbitmqPublisher',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建消息发布者
 *
 * @param request CreateRabbitmqPublisherRequest
 * @return CreateRabbitmqPublisherResponse
 */
async function createRabbitmqPublisher(request: CreateRabbitmqPublisherRequest): CreateRabbitmqPublisherResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createRabbitmqPublisherWithOptions(request, headers, runtime);
}

model CreateRamPolicyExportTaskRequest {
  authorizationAccountIds?: [ long ](name='authorizationAccountIds'),
  authorizationActions?: [ string ](name='authorizationActions'),
  authorizationRegionIds?: [ string ](name='authorizationRegionIds'),
  clientToken?: string(name='clientToken', description='This parameter is required.', example='2da11a5501f18cc5e004'),
  moduleId?: string(name='moduleId', description='This parameter is required.', example='mod-148e785fff6b316f4eb737e'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.', example='v1'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  ramRole?: string(name='ramRole', example='ramName'),
  terraformProviderVersion?: string(name='terraformProviderVersion'),
  triggerStrategy?: string(name='triggerStrategy', example='Manual'),
}

model CreateRamPolicyExportTaskResponseBody = {
  id?: string(name='id', example='rpe-436057ffe0252e48f9286a'),
  requestId?: string(name='requestId', example='9AC66641-C0F1-533B-AB58-982FC7B1C32A'),
}

model CreateRamPolicyExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateRamPolicyExportTaskResponseBody(name='body'),
}

/**
 * @summary 创建RAM策略导出任务
 *
 * @param request CreateRamPolicyExportTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateRamPolicyExportTaskResponse
 */
async function createRamPolicyExportTaskWithOptions(request: CreateRamPolicyExportTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateRamPolicyExportTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.authorizationAccountIds)) {
    body['authorizationAccountIds'] = request.authorizationAccountIds;
  }
  if (!$isNull(request.authorizationActions)) {
    body['authorizationActions'] = request.authorizationActions;
  }
  if (!$isNull(request.authorizationRegionIds)) {
    body['authorizationRegionIds'] = request.authorizationRegionIds;
  }
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }
  if (!$isNull(request.triggerStrategy)) {
    body['triggerStrategy'] = request.triggerStrategy;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateRamPolicyExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建RAM策略导出任务
 *
 * @param request CreateRamPolicyExportTaskRequest
 * @return CreateRamPolicyExportTaskResponse
 */
async function createRamPolicyExportTask(request: CreateRamPolicyExportTaskRequest): CreateRamPolicyExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createRamPolicyExportTaskWithOptions(request, headers, runtime);
}

model CreateResourceExportTaskRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  configPath?: string(name='configPath'),
  description?: string(name='description', example='OK'),
  excludeRules?: [ 
    {
      key?: string(name='key', example='VPC'),
      values?: [ string ](name='values'),
    }
  ](name='excludeRules'),
  exportToModule?: {
    source?: string(name='source', example='Registry'),
    sourcePath?: string(name='sourcePath', example='alibaba/security-group/alicloud'),
    statePath?: string(name='statePath', example='/'),
  }(name='exportToModule'),
  includeRules?: [ 
    {
      key?: string(name='key', example='ZoneId'),
      values?: [ string ](name='values'),
    }
  ](name='includeRules'),
  name?: string(name='name', description='This parameter is required.', example='abc'),
  ramRole?: string(name='ramRole', example='{}'),
  terraformProviderVersion?: string(name='terraformProviderVersion'),
  terraformVersion?: string(name='terraformVersion', example='1.2.6'),
  triggerStrategy?: string(name='triggerStrategy', example='Auto'),
  variables?: [ 
    {
      properties?: [ string ](name='properties'),
      resourceType?: string(name='resourceType', example='AliCloud::VPC::VPC'),
    }
  ](name='variables'),
}

model CreateResourceExportTaskResponseBody = {
  exportTaskId?: string(name='exportTaskId', example='ex-4a1ec8b7003d24528326821be'),
  exportVersion?: string(name='exportVersion', example='v1'),
  requestId?: string(name='requestId', example='CFD8C2A8-5BE7-56D2-916D-64039B8E06E3'),
}

model CreateResourceExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateResourceExportTaskResponseBody(name='body'),
}

/**
 * @summary 创建导出任务
 *
 * @param request CreateResourceExportTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateResourceExportTaskResponse
 */
async function createResourceExportTaskWithOptions(request: CreateResourceExportTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateResourceExportTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.configPath)) {
    body['configPath'] = request.configPath;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.excludeRules)) {
    body['excludeRules'] = request.excludeRules;
  }
  if (!$isNull(request.exportToModule)) {
    body['exportToModule'] = request.exportToModule;
  }
  if (!$isNull(request.includeRules)) {
    body['includeRules'] = request.includeRules;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }
  if (!$isNull(request.terraformVersion)) {
    body['terraformVersion'] = request.terraformVersion;
  }
  if (!$isNull(request.triggerStrategy)) {
    body['triggerStrategy'] = request.triggerStrategy;
  }
  if (!$isNull(request.variables)) {
    body['variables'] = request.variables;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateResourceExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建导出任务
 *
 * @param request CreateResourceExportTaskRequest
 * @return CreateResourceExportTaskResponse
 */
async function createResourceExportTask(request: CreateResourceExportTaskRequest): CreateResourceExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createResourceExportTaskWithOptions(request, headers, runtime);
}

model CreateTaskRequest {
  autoApply?: boolean(name='autoApply', description='This parameter is required.', example='true'),
  autoDestroy?: boolean(name='autoDestroy', example='true'),
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='demo'),
  groupInfo?: {
    groupId?: string(name='groupId', example='g-5fd38c9b92d541a7083a86432e2'),
    projectId?: string(name='projectId', example='project-433aead7560572057e5d9167608'),
  }(name='groupInfo'),
  initModuleState?: boolean(name='initModuleState'),
  moduleId?: string(name='moduleId', description='This parameter is required.', example='mod-148e7853433574fff6b316f4eb737e'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.', example='v1'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  parameters?: map[string]string(name='parameters'),
  protectionStrategy?: [ string ](name='protectionStrategy'),
  ramRole?: string(name='ramRole', description='This parameter is required.', example='{}'),
  skipPropertyValidation?: boolean(name='skipPropertyValidation'),
  taskBackend?: {
    bucketEndpoint?: string(name='bucketEndpoint'),
    bucketName?: string(name='bucketName'),
    objectPath?: string(name='objectPath'),
  }(name='taskBackend'),
  terraformVersion?: string(name='terraformVersion', example='1.2.6'),
  triggerStrategy?: string(name='triggerStrategy', description='This parameter is required.', example='Always'),
  triggerValue?: string(name='triggerValue', example='******'),
}

model CreateTaskResponseBody = {
  requestId?: string(name='requestId', example='CD478792-6952-5A1C-9F57-78932BF0FAC6'),
  taskId?: string(name='taskId', example='task-433aead756057fffeaba4828f5195'),
}

model CreateTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTaskResponseBody(name='body'),
}

/**
 * @summary 创建任务
 *
 * @param request CreateTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTaskResponse
 */
async function createTaskWithOptions(request: CreateTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): CreateTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoApply)) {
    body['autoApply'] = request.autoApply;
  }
  if (!$isNull(request.autoDestroy)) {
    body['autoDestroy'] = request.autoDestroy;
  }
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.groupInfo)) {
    body['groupInfo'] = request.groupInfo;
  }
  if (!$isNull(request.initModuleState)) {
    body['initModuleState'] = request.initModuleState;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.parameters)) {
    body['parameters'] = request.parameters;
  }
  if (!$isNull(request.protectionStrategy)) {
    body['protectionStrategy'] = request.protectionStrategy;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.skipPropertyValidation)) {
    body['skipPropertyValidation'] = request.skipPropertyValidation;
  }
  if (!$isNull(request.taskBackend)) {
    body['taskBackend'] = request.taskBackend;
  }
  if (!$isNull(request.terraformVersion)) {
    body['terraformVersion'] = request.terraformVersion;
  }
  if (!$isNull(request.triggerStrategy)) {
    body['triggerStrategy'] = request.triggerStrategy;
  }
  if (!$isNull(request.triggerValue)) {
    body['triggerValue'] = request.triggerValue;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建任务
 *
 * @param request CreateTaskRequest
 * @return CreateTaskResponse
 */
async function createTask(request: CreateTaskRequest): CreateTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return createTaskWithOptions(request, headers, runtime);
}

model DeleteAuthorizationResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='BF72A6FB-B071-5F2E-A036-9D62545B962C'),
}

model DeleteAuthorizationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAuthorizationResponseBody(name='body'),
}

/**
 * @summary 删除共享
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAuthorizationResponse
 */
async function deleteAuthorizationWithOptions(authorizationId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteAuthorizationResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteAuthorization',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/authorizations/${$URL.percentEncode(authorizationId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除共享
 *
 * @return DeleteAuthorizationResponse
 */
async function deleteAuthorization(authorizationId: string): DeleteAuthorizationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteAuthorizationWithOptions(authorizationId, headers, runtime);
}

model DeleteGroupResponseBody = {
  requestId?: string(name='requestId', example='1E7BA3EB-B0EF-53F5-9999-07CAD6D9F8A3'),
}

model DeleteGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGroupResponseBody(name='body'),
}

/**
 * @summary 删除分组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGroupResponse
 */
async function deleteGroupWithOptions(groupId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteGroupResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/${$URL.percentEncode(groupId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除分组
 *
 * @return DeleteGroupResponse
 */
async function deleteGroup(groupId: string): DeleteGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteGroupWithOptions(groupId, headers, runtime);
}

model DeleteModuleResponseBody = {
  requestId?: string(name='requestId', example='49DA6457-E545-5095-A930-EB8F0BCD4DAA'),
}

model DeleteModuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteModuleResponseBody(name='body'),
}

/**
 * @summary 删除模版
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteModuleResponse
 */
async function deleteModuleWithOptions(moduleId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteModuleResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteModule',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/${$URL.percentEncode(moduleId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除模版
 *
 * @return DeleteModuleResponse
 */
async function deleteModule(moduleId: string): DeleteModuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteModuleWithOptions(moduleId, headers, runtime);
}

model DeleteParameterSetResponseBody = {
  requestId?: string(name='requestId', example='708D670B-67C4-5653-9F88-8F7800429EE1'),
}

model DeleteParameterSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteParameterSetResponseBody(name='body'),
}

/**
 * @summary 删除参数集
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteParameterSetResponse
 */
async function deleteParameterSetWithOptions(parameterSetId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteParameterSetResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteParameterSet',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets/${$URL.percentEncode(parameterSetId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除参数集
 *
 * @return DeleteParameterSetResponse
 */
async function deleteParameterSet(parameterSetId: string): DeleteParameterSetResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteParameterSetWithOptions(parameterSetId, headers, runtime);
}

model DeleteProjectResponseBody = {
  requestId?: string(name='requestId', example='BF72A6FB-B071-5F2E-A036-9D62545B962C'),
}

model DeleteProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProjectResponseBody(name='body'),
}

/**
 * @summary 删除项目
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProjectResponse
 */
async function deleteProjectWithOptions(projectId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteProjectResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteProject',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除项目
 *
 * @return DeleteProjectResponse
 */
async function deleteProject(projectId: string): DeleteProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProjectWithOptions(projectId, headers, runtime);
}

model DeleteRabbitmqPublisherResponseBody = {
  requestId?: string(name='requestId', example='BF72A6FB-B071-5F2E-A036-9D62545B962C'),
}

model DeleteRabbitmqPublisherResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRabbitmqPublisherResponseBody(name='body'),
}

/**
 * @summary 删除消息发布者
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRabbitmqPublisherResponse
 */
async function deleteRabbitmqPublisherWithOptions(publisherId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteRabbitmqPublisherResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRabbitmqPublisher',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers/${$URL.percentEncode(publisherId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除消息发布者
 *
 * @return DeleteRabbitmqPublisherResponse
 */
async function deleteRabbitmqPublisher(publisherId: string): DeleteRabbitmqPublisherResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRabbitmqPublisherWithOptions(publisherId, headers, runtime);
}

model DeleteRamPolicyExportTaskResponseBody = {
  requestId?: string(name='requestId', example='3E49127A-BB65-5CCD-AB93-0EC0A43E5446'),
}

model DeleteRamPolicyExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRamPolicyExportTaskResponseBody(name='body'),
}

/**
 * @summary 删除RAM策略导出任务
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRamPolicyExportTaskResponse
 */
async function deleteRamPolicyExportTaskWithOptions(ramPolicyExportTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteRamPolicyExportTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRamPolicyExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除RAM策略导出任务
 *
 * @return DeleteRamPolicyExportTaskResponse
 */
async function deleteRamPolicyExportTask(ramPolicyExportTaskId: string): DeleteRamPolicyExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRamPolicyExportTaskWithOptions(ramPolicyExportTaskId, headers, runtime);
}

model DeleteRamPolicyExportTaskVersionResponseBody = {
  requestId?: string(name='requestId', example='E2D0E863-1651-5E58-823F-B451C8C24615'),
}

model DeleteRamPolicyExportTaskVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteRamPolicyExportTaskVersionResponseBody(name='body'),
}

/**
 * @summary 删除RAM策略导出任务版本
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteRamPolicyExportTaskVersionResponse
 */
async function deleteRamPolicyExportTaskVersionWithOptions(ramPolicyExportTaskId: string, exportVersion: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteRamPolicyExportTaskVersionResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteRamPolicyExportTaskVersion',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}/versions/${$URL.percentEncode(exportVersion)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除RAM策略导出任务版本
 *
 * @return DeleteRamPolicyExportTaskVersionResponse
 */
async function deleteRamPolicyExportTaskVersion(ramPolicyExportTaskId: string, exportVersion: string): DeleteRamPolicyExportTaskVersionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteRamPolicyExportTaskVersionWithOptions(ramPolicyExportTaskId, exportVersion, headers, runtime);
}

model DeleteResourceExportTaskResponseBody = {
  requestId?: string(name='requestId', example='136B3926-DD90-5DB2-96EC-8BAD6407D1C9'),
}

model DeleteResourceExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResourceExportTaskResponseBody(name='body'),
}

/**
 * @summary 删除任务
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResourceExportTaskResponse
 */
async function deleteResourceExportTaskWithOptions(exportTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteResourceExportTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteResourceExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/${$URL.percentEncode(exportTaskId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除任务
 *
 * @return DeleteResourceExportTaskResponse
 */
async function deleteResourceExportTask(exportTaskId: string): DeleteResourceExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteResourceExportTaskWithOptions(exportTaskId, headers, runtime);
}

model DeleteSceneTestingTaskResponseBody = {
  requestId?: string(name='requestId', example='17793D91-A26F-520D-A948-3452A45D15B1'),
}

model DeleteSceneTestingTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSceneTestingTaskResponseBody(name='body'),
}

/**
 * @summary 删除场景化测试任务
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSceneTestingTaskResponse
 */
async function deleteSceneTestingTaskWithOptions(taskId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteSceneTestingTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSceneTestingTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/sceneTestingTask/${$URL.percentEncode(taskId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除场景化测试任务
 *
 * @return DeleteSceneTestingTaskResponse
 */
async function deleteSceneTestingTask(taskId: string): DeleteSceneTestingTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSceneTestingTaskWithOptions(taskId, headers, runtime);
}

model DeleteTaskResponseBody = {
  requestId?: string(name='requestId', example='73B38F77-62BA-5878-8952-530DFE21C93B'),
}

model DeleteTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTaskResponseBody(name='body'),
}

/**
 * @summary 删除任务
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTaskResponse
 */
async function deleteTaskWithOptions(taskId: string, headers: map[string]string, runtime: $RuntimeOptions): DeleteTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除任务
 *
 * @return DeleteTaskResponse
 */
async function deleteTask(taskId: string): DeleteTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteTaskWithOptions(taskId, headers, runtime);
}

model DetachRabbitmqPublisherRequest {
  taskId?: string(name='taskId', description='This parameter is required.', example='task-518855d9a058cf1127d082bec5'),
}

model DetachRabbitmqPublisherResponseBody = {
  requestId?: string(name='requestId', example='BF72A6FB-B071-5F2E-A036-9D62545B962C'),
}

model DetachRabbitmqPublisherResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachRabbitmqPublisherResponseBody(name='body'),
}

/**
 * @summary 将消息发布者从任务上卸载
 *
 * @param request DetachRabbitmqPublisherRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachRabbitmqPublisherResponse
 */
async function detachRabbitmqPublisherWithOptions(publisherId: string, request: DetachRabbitmqPublisherRequest, headers: map[string]string, runtime: $RuntimeOptions): DetachRabbitmqPublisherResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.taskId)) {
    body['taskId'] = request.taskId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetachRabbitmqPublisher',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers/${$URL.percentEncode(publisherId)}/detach`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 将消息发布者从任务上卸载
 *
 * @param request DetachRabbitmqPublisherRequest
 * @return DetachRabbitmqPublisherResponse
 */
async function detachRabbitmqPublisher(publisherId: string, request: DetachRabbitmqPublisherRequest): DetachRabbitmqPublisherResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return detachRabbitmqPublisherWithOptions(publisherId, request, headers, runtime);
}

model DissociateGroupRequest {
  clientToken?: string(name='clientToken', example='2daf4227f747cbf11a5501f18cc5e004'),
  resourceIds?: [ string ](name='resourceIds', description='This parameter is required.'),
  resourceType?: string(name='resourceType', example='Task'),
}

model DissociateGroupResponseBody = {
  requestId?: string(name='requestId', example='17793D91-A26F-520D-A948-3452A45D15B1'),
}

model DissociateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateGroupResponseBody(name='body'),
}

/**
 * @summary 取消关联分组
 *
 * @param request DissociateGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateGroupResponse
 */
async function dissociateGroupWithOptions(projectId: string, groupId: string, request: DissociateGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): DissociateGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.resourceIds)) {
    body['resourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DissociateGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/${$URL.percentEncode(groupId)}/dissociate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消关联分组
 *
 * @param request DissociateGroupRequest
 * @return DissociateGroupResponse
 */
async function dissociateGroup(projectId: string, groupId: string, request: DissociateGroupRequest): DissociateGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return dissociateGroupWithOptions(projectId, groupId, request, headers, runtime);
}

model DissociateParameterSetRequest {
  parameterSetIds?: [ string ](name='parameterSetIds', description='This parameter is required.'),
  resourceId?: string(name='resourceId', description='This parameter is required.', example='mod-39cd1e5e58c50e79dd8cd901cd'),
  resourceType?: string(name='resourceType', description='This parameter is required.', example='Module'),
}

model DissociateParameterSetResponseBody = {
  requestId?: string(name='requestId', example='136B3926-DD90-5DB2-96EC-8BAD6407D1C9'),
}

model DissociateParameterSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DissociateParameterSetResponseBody(name='body'),
}

/**
 * @summary 解除参数集关联资源关系
 *
 * @param request DissociateParameterSetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DissociateParameterSetResponse
 */
async function dissociateParameterSetWithOptions(request: DissociateParameterSetRequest, headers: map[string]string, runtime: $RuntimeOptions): DissociateParameterSetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.parameterSetIds)) {
    body['parameterSetIds'] = request.parameterSetIds;
  }
  if (!$isNull(request.resourceId)) {
    body['resourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DissociateParameterSet',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets/operations/dissociate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 解除参数集关联资源关系
 *
 * @param request DissociateParameterSetRequest
 * @return DissociateParameterSetResponse
 */
async function dissociateParameterSet(request: DissociateParameterSetRequest): DissociateParameterSetResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return dissociateParameterSetWithOptions(request, headers, runtime);
}

model ExecuteRamPolicyExportTaskResponseBody = {
  exportVersion?: string(name='exportVersion', example='v1'),
  requestId?: string(name='requestId', example='7FA0FF4A-ABD4-54F6-BEAC-B4273EBA10A2'),
}

model ExecuteRamPolicyExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteRamPolicyExportTaskResponseBody(name='body'),
}

/**
 * @summary 执行RAM策略导出任务
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteRamPolicyExportTaskResponse
 */
async function executeRamPolicyExportTaskWithOptions(ramPolicyExportTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): ExecuteRamPolicyExportTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'ExecuteRamPolicyExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}/execute`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 执行RAM策略导出任务
 *
 * @return ExecuteRamPolicyExportTaskResponse
 */
async function executeRamPolicyExportTask(ramPolicyExportTaskId: string): ExecuteRamPolicyExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return executeRamPolicyExportTaskWithOptions(ramPolicyExportTaskId, headers, runtime);
}

model ExecuteResourceExportTaskRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  ramRole?: string(name='ramRole', example='{}'),
}

model ExecuteResourceExportTaskResponseBody = {
  exportTaskId?: string(name='exportTaskId', example='ex-3b6cb9fa4751a6e645ad8365e6'),
  exportVersion?: string(name='exportVersion', example='v1'),
  requestId?: string(name='requestId', example='0B0A7C19-9077-5975-ACBD-DEE718787992'),
}

model ExecuteResourceExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExecuteResourceExportTaskResponseBody(name='body'),
}

/**
 * @summary 执行资源导出任务
 *
 * @param request ExecuteResourceExportTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExecuteResourceExportTaskResponse
 */
async function executeResourceExportTaskWithOptions(exportTaskId: string, request: ExecuteResourceExportTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): ExecuteResourceExportTaskResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ExecuteResourceExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/execute/${$URL.percentEncode(exportTaskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 执行资源导出任务
 *
 * @param request ExecuteResourceExportTaskRequest
 * @return ExecuteResourceExportTaskResponse
 */
async function executeResourceExportTask(exportTaskId: string, request: ExecuteResourceExportTaskRequest): ExecuteResourceExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return executeResourceExportTaskWithOptions(exportTaskId, request, headers, runtime);
}

model GetExplorerTaskResponseBody = {
  requestId?: string(name='requestId'),
  task?: {
    autoApply?: boolean(name='autoApply'),
    autoDestroy?: boolean(name='autoDestroy'),
    createTime?: string(name='createTime'),
    currentJobId?: string(name='currentJobId'),
    description?: string(name='description'),
    explorerTaskId?: string(name='explorerTaskId'),
    initModuleState?: boolean(name='initModuleState'),
    moduleId?: string(name='moduleId'),
    moduleVersion?: string(name='moduleVersion'),
    name?: string(name='name'),
    skipPropertyValidation?: boolean(name='skipPropertyValidation'),
    status?: string(name='status'),
    taskOutputPath?: string(name='taskOutputPath'),
    terraformVersion?: string(name='terraformVersion'),
    triggerValue?: string(name='triggerValue'),
    uploadSignature?: {
      accessKeyId?: string(name='accessKeyId'),
      bucketName?: string(name='bucketName'),
      key?: string(name='key'),
      policy?: string(name='policy'),
      signature?: string(name='signature'),
      url?: string(name='url'),
    }(name='uploadSignature'),
  }(name='task'),
}

model GetExplorerTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExplorerTaskResponseBody(name='body'),
}

/**
 * @summary 查询Explorer任务详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExplorerTaskResponse
 */
async function getExplorerTaskWithOptions(explorerTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): GetExplorerTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetExplorerTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/explorerTask/${$URL.percentEncode(explorerTaskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询Explorer任务详情
 *
 * @return GetExplorerTaskResponse
 */
async function getExplorerTask(explorerTaskId: string): GetExplorerTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getExplorerTaskWithOptions(explorerTaskId, headers, runtime);
}

model GetGroupResponseBody = {
  group?: {
    autoDestroy?: boolean(name='autoDestroy', example='true'),
    autoTrigger?: boolean(name='autoTrigger', example='true'),
    createTime?: string(name='createTime', example='2022-08-21T10:57:11Z'),
    description?: string(name='description', example='OK'),
    forcedSetting?: boolean(name='forcedSetting', example='true'),
    groupId?: string(name='groupId', example='g-14e80de4866bf7ffed0bab6154d738'),
    name?: string(name='name', example='abc'),
    notifyConfig?: [ 
      {
        notifyPath?: string(name='notifyPath', example='/'),
        notifyType?: string(name='notifyType', example='DingDing'),
      }
    ](name='notifyConfig'),
    notifyOperationTypes?: [ string ](name='notifyOperationTypes'),
    projectId?: string(name='projectId', example='p-4267dcfbf1b6d126edcadf0e949'),
    ramRole?: string(name='ramRole', example='ramRoleName'),
    reportExportField?: [ string ](name='reportExportField'),
    reportExportPath?: string(name='reportExportPath', example='/'),
    taskCnt?: long(name='taskCnt', example='3'),
    terraformProviderVersion?: string(name='terraformProviderVersion', example='1.191.0'),
    triggerConfig?: [ 
      {
        triggerStrategy?: string(name='triggerStrategy', example='Cron'),
        triggerValue?: string(name='triggerValue', example='0 0 8 * * ?'),
      }
    ](name='triggerConfig'),
    triggerResourceType?: [ string ](name='triggerResourceType'),
  }(name='group'),
  requestId?: string(name='requestId', example='B6ED9F71-7FA8-598E-B64D-4606FB3FCCC9'),
}

model GetGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetGroupResponseBody(name='body'),
}

/**
 * @summary 查询分组
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetGroupResponse
 */
async function getGroupWithOptions(groupId: string, headers: map[string]string, runtime: $RuntimeOptions): GetGroupResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/${$URL.percentEncode(groupId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询分组
 *
 * @return GetGroupResponse
 */
async function getGroup(groupId: string): GetGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getGroupWithOptions(groupId, headers, runtime);
}

model GetJobRequest {
  taskType?: string(name='taskType'),
}

model GetJobResponseBody = {
  job?: {
    assertCheckDetail?: [ 
      {
        comparison?: string(name='comparison', example='eq'),
        expectedValue?: string(name='expectedValue'),
        isPass?: boolean(name='isPass', example='true'),
        type?: string(name='type', example='result'),
      }
    ](name='assertCheckDetail'),
    config?: {
      autoApply?: boolean(name='autoApply', example='true'),
      isDestroy?: boolean(name='isDestroy', example='fales'),
      moduleVersion?: string(name='moduleVersion', example='v1'),
      resourcesChanged?: string(name='resourcesChanged', example='{}'),
      subCommand?: string(name='subCommand'),
    }(name='config'),
    createTime?: string(name='createTime', example='2022-08-31T03:38:40Z'),
    description?: string(name='description', example='test1'),
    downloadUrl?: map[string]any(name='downloadUrl'),
    elapsedTime?: long(name='elapsedTime'),
    executeType?: string(name='executeType'),
    isPassAssertCheck?: boolean(name='isPassAssertCheck', example='true'),
    jobId?: string(name='jobId', example='job-518855d9a058cfff0dc933e6b5767'),
    output?: string(name='output', example='/'),
    parameters?: map[string]string(name='parameters'),
    runtimeType?: string(name='runtimeType'),
    status?: string(name='status', example='Errored'),
    statusDetail?: map[string]JobStatusDetailValue(name='statusDetail'),
    taskId?: string(name='taskId', example='task-3b6cb9fa4751a1b9b5f22cbcf4e'),
    taskType?: string(name='taskType'),
    terraformProviderVersion?: string(name='terraformProviderVersion'),
  }(name='job'),
  requestId?: string(name='requestId', example='1435C78A-AED9-53D6-B7A6-E2661D29B1FA'),
}

model GetJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobResponseBody(name='body'),
}

/**
 * @summary 作业详情
 *
 * @param request GetJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobResponse
 */
async function getJobWithOptions(taskId: string, jobId: string, request: GetJobRequest, headers: map[string]string, runtime: $RuntimeOptions): GetJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.taskType)) {
    query['taskType'] = request.taskType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetJob',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}/jobs/${$URL.percentEncode(jobId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 作业详情
 *
 * @param request GetJobRequest
 * @return GetJobResponse
 */
async function getJob(taskId: string, jobId: string, request: GetJobRequest): GetJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getJobWithOptions(taskId, jobId, request, headers, runtime);
}

model GetModuleResponseBody = {
  module?: {
    createTime?: string(name='createTime', example='2022-09-06T06:11:27Z'),
    description?: string(name='description', example='test1'),
    latestVersion?: string(name='latestVersion', example='v1'),
    moduleId?: string(name='moduleId', example='mod-4267dcfbf1b6d14625614ddbe15'),
    name?: string(name='name', example='abc'),
    outputPath?: string(name='outputPath', example='/'),
    source?: string(name='source', example='OSS'),
    sourcePath?: string(name='sourcePath', example='OSS：
"oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/code.zip"
Registry：
"alibaba/security-group/alicloud:2.1.0"'),
    statePath?: string(name='statePath', example='oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/terraform.tfstate'),
    status?: string(name='status', example='Created'),
    versionStrategy?: string(name='versionStrategy', example='Manual'),
  }(name='module'),
  requestId?: string(name='requestId', description='Id of the request', example='1E7BA3EB-B0EF-53F5-9999-07CAD6D9F8A3'),
}

model GetModuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetModuleResponseBody(name='body'),
}

/**
 * @summary 获取模版详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetModuleResponse
 */
async function getModuleWithOptions(moduleId: string, headers: map[string]string, runtime: $RuntimeOptions): GetModuleResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetModule',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/${$URL.percentEncode(moduleId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取模版详情
 *
 * @return GetModuleResponse
 */
async function getModule(moduleId: string): GetModuleResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getModuleWithOptions(moduleId, headers, runtime);
}

model GetModuleVersionResponseBody = {
  requestId?: string(name='requestId', example='0D298375-F92F-5B65-82E4-EA68F02521F1'),
  version?: {
    createTime?: string(name='createTime', example='2022-09-08T18:07:40Z'),
    description?: string(name='description', example='description'),
    moduleId?: string(name='moduleId', example='mod-4267dcfbf1b6dfffbc27e218d1b66'),
    moduleVersion?: string(name='moduleVersion', example='v1'),
    name?: string(name='name'),
    source?: string(name='source', example='OSS'),
    sourcePath?: string(name='sourcePath', example='oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/code.zip'),
    statePath?: string(name='statePath', example='oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/terraform.tfstate'),
    terraformContext?: map[string]any(name='terraformContext'),
    versionStrategy?: string(name='versionStrategy', example='Manual'),
  }(name='version'),
}

model GetModuleVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetModuleVersionResponseBody(name='body'),
}

/**
 * @summary 模版版本详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetModuleVersionResponse
 */
async function getModuleVersionWithOptions(moduleId: string, moduleVersion: string, headers: map[string]string, runtime: $RuntimeOptions): GetModuleVersionResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetModuleVersion',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/${$URL.percentEncode(moduleId)}/versions/${$URL.percentEncode(moduleVersion)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 模版版本详情
 *
 * @return GetModuleVersionResponse
 */
async function getModuleVersion(moduleId: string, moduleVersion: string): GetModuleVersionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getModuleVersionWithOptions(moduleId, moduleVersion, headers, runtime);
}

model GetParameterSetResponseBody = {
  parameterSet?: {
    createTime?: string(name='createTime', example='2022-01-30T02:14:16Z'),
    description?: string(name='description', example='OK'),
    name?: string(name='name', example='abc'),
    parameterSetId?: string(name='parameterSetId', example='pts-3b6cb9fa4751afff9c5e4e01624b9'),
    parameters?: [ 
      {
        name?: string(name='name', example='test1121'),
        type?: string(name='type', example='string'),
        value?: any(name='value', example='vpc-2ze83xrka9ktxy0pnaxn5'),
      }
    ](name='parameters'),
    relationList?: [ 
      {
        createTime?: string(name='createTime', example='2022-04-24T22:58:50Z'),
        resourceId?: string(name='resourceId', example='mod-433aead756057101546eb5d50c1'),
        resourceType?: string(name='resourceType', example='Module'),
      }
    ](name='relationList'),
  }(name='parameterSet'),
  requestId?: string(name='requestId', example='99905C7C-1320-5E7F-A798-3071482EB08E'),
}

model GetParameterSetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetParameterSetResponseBody(name='body'),
}

/**
 * @summary 参数集详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetParameterSetResponse
 */
async function getParameterSetWithOptions(parameterSetId: string, headers: map[string]string, runtime: $RuntimeOptions): GetParameterSetResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetParameterSet',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets/${$URL.percentEncode(parameterSetId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 参数集详情
 *
 * @return GetParameterSetResponse
 */
async function getParameterSet(parameterSetId: string): GetParameterSetResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getParameterSetWithOptions(parameterSetId, headers, runtime);
}

model GetProjectResponseBody = {
  project?: {
    createTime?: string(name='createTime', example='2022-09-06T06:11:27Z'),
    description?: string(name='description', example='abc'),
    name?: string(name='name', example='abc'),
    projectId?: string(name='projectId', example='p-433aead7560572f8d95b25775c'),
    taskCnt?: long(name='taskCnt', example='2'),
  }(name='project'),
  requestId?: string(name='requestId', example='7FA0FF4A-ABD4-54F6-BEAC-B4273EBA10A2'),
}

model GetProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectResponseBody(name='body'),
}

/**
 * @summary 查询项目
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectResponse
 */
async function getProjectWithOptions(projectId: string, headers: map[string]string, runtime: $RuntimeOptions): GetProjectResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetProject',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询项目
 *
 * @return GetProjectResponse
 */
async function getProject(projectId: string): GetProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectWithOptions(projectId, headers, runtime);
}

model GetProjectBuildContextRequest {
  isPassAssertCheck?: boolean(name='isPassAssertCheck'),
  status?: string(name='status'),
}

model GetProjectBuildContextResponseBody = {
  projectBuild?: {
    endTime?: string(name='endTime', example='1646719546155'),
    failCnt?: long(name='failCnt', example='2'),
    jobList?: [ 
      {
        elapsedTime?: long(name='elapsedTime'),
        isDeleted?: long(name='isDeleted', example='0'),
        isPassAssertCheck?: boolean(name='isPassAssertCheck'),
        jobId?: string(name='jobId', example='job-518855d9a058cfff262b993646d12'),
        moduleId?: string(name='moduleId', example='mod-3b6cb9fa4751a107afd6c2c3eb9'),
        moduleName?: string(name='moduleName'),
        moduleVersion?: string(name='moduleVersion', example='v1'),
        name?: string(name='name', example='test7'),
        status?: string(name='status', example='Pending'),
        taskId?: string(name='taskId', example='task-433aead756057ffe67aefed4aa75d'),
        terraformProviderVersion?: string(name='terraformProviderVersion'),
        type?: string(name='type'),
      }
    ](name='jobList'),
    jobTotalCnt?: long(name='jobTotalCnt', example='3'),
    projectBuildId?: string(name='projectBuildId', example='pb-4267dcfbf1b6d13c7d2386cba7'),
    projectId?: string(name='projectId', example='p-4267dcfbf1b6d1e0652bfbbe994'),
    resourceCnt?: long(name='resourceCnt', example='0'),
    resourceList?: [ 
      {
        info?: map[string]string(name='info'),
        resourceCnt?: long(name='resourceCnt', example='1'),
        resourceType?: string(name='resourceType', example='Module'),
      }
    ](name='resourceList'),
    resourceTypeCnt?: long(name='resourceTypeCnt', example='0'),
    status?: string(name='status', example='Pending'),
    successCnt?: long(name='successCnt', example='1'),
    terraformProviderVersion?: string(name='terraformProviderVersion'),
    triggerStrategy?: string(name='triggerStrategy'),
  }(name='ProjectBuild'),
  requestId?: string(name='requestId', description='Id of the request', example='C54F3939-9112-5795-A5A7-5322E2FB2257'),
}

model GetProjectBuildContextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectBuildContextResponseBody(name='body'),
}

/**
 * @summary 项目批次概览
 *
 * @param request GetProjectBuildContextRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectBuildContextResponse
 */
async function getProjectBuildContextWithOptions(projectId: string, projectBuildId: string, request: GetProjectBuildContextRequest, headers: map[string]string, runtime: $RuntimeOptions): GetProjectBuildContextResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.isPassAssertCheck)) {
    query['isPassAssertCheck'] = request.isPassAssertCheck;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetProjectBuildContext',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}/build/${$URL.percentEncode(projectBuildId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 项目批次概览
 *
 * @param request GetProjectBuildContextRequest
 * @return GetProjectBuildContextResponse
 */
async function getProjectBuildContext(projectId: string, projectBuildId: string, request: GetProjectBuildContextRequest): GetProjectBuildContextResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectBuildContextWithOptions(projectId, projectBuildId, request, headers, runtime);
}

model GetRabbitmqPublisherResponseBody = {
  publisher?: {
    createTime?: string(name='createTime', example='2022-10-05T06:07:48Z'),
    description?: string(name='description', example='description'),
    exchangeName?: string(name='exchangeName', example='ExchangeTest'),
    exchangeType?: string(name='exchangeType', example='TOPIC'),
    hostName?: string(name='hostName', example='1880770****.mq-amqp.cn-hangzhou-a.aliyuncs.com'),
    name?: string(name='name', example='test123'),
    port?: long(name='port', example='5671'),
    publisherId?: string(name='publisherId', example='mqp-3b6cb9fa4751a6fa1b69b8dca1'),
    taskIds?: [ string ](name='taskIds'),
    userName?: string(name='userName', example='MjoxODgwNzcwODY5MD****'),
    virtualHost?: string(name='virtualHost', example='MjoxODgwNzcwODY5MD****'),
  }(name='publisher'),
  requestId?: string(name='requestId', example='1E7BA3EB-B0EF-53F5-9999-07CAD6D9F8A3'),
}

model GetRabbitmqPublisherResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRabbitmqPublisherResponseBody(name='body'),
}

/**
 * @summary 获取消息发布者详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRabbitmqPublisherResponse
 */
async function getRabbitmqPublisherWithOptions(publisherId: string, headers: map[string]string, runtime: $RuntimeOptions): GetRabbitmqPublisherResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRabbitmqPublisher',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers/${$URL.percentEncode(publisherId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取消息发布者详情
 *
 * @return GetRabbitmqPublisherResponse
 */
async function getRabbitmqPublisher(publisherId: string): GetRabbitmqPublisherResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRabbitmqPublisherWithOptions(publisherId, headers, runtime);
}

model GetRamPolicyExportTaskResponseBody = {
  ramPolicyExportTask?: {
    authorizationAccountIds?: [ long ](name='authorizationAccountIds'),
    authorizationActions?: [ string ](name='authorizationActions'),
    authorizationRegionIds?: [ string ](name='authorizationRegionIds'),
    createTime?: string(name='createTime', example='2022-06-16T10:03:39Z'),
    moduleId?: string(name='moduleId', example='mod-66c23a9cc0cacddf'),
    moduleVersion?: string(name='moduleVersion', example='v1'),
    name?: string(name='name', example='test'),
    ramPolicyExportTaskId?: string(name='ramPolicyExportTaskId', example='rpe-40252e48f9286a'),
    ramRole?: string(name='ramRole', example='ramName'),
    status?: string(name='status', example='Available'),
    taskOutputPath?: string(name='taskOutputPath', example='12345678/default/rampolicytask/rpe-4399111870d7e6b0f11a'),
    terraformProviderVersion?: string(name='terraformProviderVersion'),
    triggerStrategy?: string(name='triggerStrategy', example='Manual'),
  }(name='ramPolicyExportTask'),
  requestId?: string(name='requestId', example='3E49127A-BB65-5CCD-AB93-0EC0A43E5446'),
}

model GetRamPolicyExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRamPolicyExportTaskResponseBody(name='body'),
}

/**
 * @summary 获取RAM策略导出任务详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRamPolicyExportTaskResponse
 */
async function getRamPolicyExportTaskWithOptions(ramPolicyExportTaskId: string, headers: map[string]string, runtime: $RuntimeOptions): GetRamPolicyExportTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRamPolicyExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取RAM策略导出任务详情
 *
 * @return GetRamPolicyExportTaskResponse
 */
async function getRamPolicyExportTask(ramPolicyExportTaskId: string): GetRamPolicyExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRamPolicyExportTaskWithOptions(ramPolicyExportTaskId, headers, runtime);
}

model GetRamPolicyExportTaskVersionResponseBody = {
  ramPolicyExportTaskVersion?: {
    authorizationAccountIds?: [ long ](name='authorizationAccountIds'),
    authorizationActions?: [ string ](name='authorizationActions'),
    authorizationRegionIds?: [ string ](name='authorizationRegionIds'),
    createTime?: string(name='createTime', example='2022-07-18T06:32:06Z'),
    elapsedTime?: long(name='elapsedTime'),
    exportVersion?: string(name='exportVersion', example='v1'),
    failedReason?: string(name='failedReason', example='the ram policy export task has time out, The maximum running time is 1 hour'),
    missingActions?: [ string ](name='missingActions'),
    moduleId?: string(name='moduleId', example='mod-4357ffeebf6b577c4afa'),
    moduleVersion?: string(name='moduleVersion', example='v1'),
    noSupportResourceTypes?: [ string ](name='noSupportResourceTypes'),
    policyDocument?: string(name='policyDocument', example='"{
    "version": "1",
    "statement": [
      {
        "effect": "Allow",
        "action": [
          "ecs:*"
        ],
        "resource": [
          "*"
        ],
        "condition": null,
        "supportVariables": []
      }
    ]
  }"'),
    ramPolicyExportTaskId?: string(name='ramPolicyExportTaskId', example='rpe-43ffe0252e48f9286a'),
    status?: string(name='status', example='Success'),
    terraformProviderVersion?: string(name='terraformProviderVersion'),
    unauthorizedActions?: [ string ](name='unauthorizedActions'),
    warnMessage?: string(name='warnMessage'),
  }(name='ramPolicyExportTaskVersion'),
  requestId?: string(name='requestId', example='E2D0E863-1651-5E58-823F-B451C8C24615'),
}

model GetRamPolicyExportTaskVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetRamPolicyExportTaskVersionResponseBody(name='body'),
}

/**
 * @summary 获取RAM策略导出任务版本详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetRamPolicyExportTaskVersionResponse
 */
async function getRamPolicyExportTaskVersionWithOptions(ramPolicyExportTaskId: string, exportVersion: string, headers: map[string]string, runtime: $RuntimeOptions): GetRamPolicyExportTaskVersionResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetRamPolicyExportTaskVersion',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}/versions/${$URL.percentEncode(exportVersion)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取RAM策略导出任务版本详情
 *
 * @return GetRamPolicyExportTaskVersionResponse
 */
async function getRamPolicyExportTaskVersion(ramPolicyExportTaskId: string, exportVersion: string): GetRamPolicyExportTaskVersionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getRamPolicyExportTaskVersionWithOptions(ramPolicyExportTaskId, exportVersion, headers, runtime);
}

model GetResourceExportTaskRequest {
  exportVersion?: string(name='exportVersion'),
}

model GetResourceExportTaskResponseBody = {
  requestId?: string(name='requestId'),
  task?: {
    configPath?: string(name='configPath'),
    createTime?: string(name='createTime'),
    description?: string(name='description'),
    elapsedTime?: long(name='elapsedTime'),
    excludeRules?: [ 
      {
        key?: string(name='key'),
        values?: [ string ](name='values'),
      }
    ](name='excludeRules'),
    exportTaskId?: string(name='exportTaskId'),
    exportToModule?: {
      source?: string(name='source'),
      sourcePath?: string(name='sourcePath'),
      statePath?: string(name='statePath'),
    }(name='exportToModule'),
    exportVersion?: string(name='exportVersion'),
    failedReason?: string(name='failedReason'),
    includeRules?: [ 
      {
        key?: string(name='key'),
        values?: [ string ](name='values'),
      }
    ](name='includeRules'),
    modules?: [ 
      {
        source?: string(name='source'),
        sourcePath?: string(name='sourcePath'),
        version?: string(name='version'),
      }
    ](name='modules'),
    name?: string(name='name'),
    ramRole?: string(name='ramRole'),
    status?: string(name='status'),
    taskOutputPath?: string(name='taskOutputPath'),
    terraformContext?: map[string]any(name='terraformContext'),
    terraformProviderVersion?: string(name='terraformProviderVersion'),
    terraformVersion?: string(name='terraformVersion'),
    triggerStrategy?: string(name='triggerStrategy'),
    variables?: [ 
      {
        properties?: [ string ](name='properties'),
        resourceType?: string(name='resourceType'),
      }
    ](name='variables'),
  }(name='task'),
}

model GetResourceExportTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceExportTaskResponseBody(name='body'),
}

/**
 * @summary 查询导出任务详情
 *
 * @param request GetResourceExportTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceExportTaskResponse
 */
async function getResourceExportTaskWithOptions(exportTaskId: string, request: GetResourceExportTaskRequest, headers: map[string]string, runtime: $RuntimeOptions): GetResourceExportTaskResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.exportVersion)) {
    query['exportVersion'] = request.exportVersion;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetResourceExportTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/${$URL.percentEncode(exportTaskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询导出任务详情
 *
 * @param request GetResourceExportTaskRequest
 * @return GetResourceExportTaskResponse
 */
async function getResourceExportTask(exportTaskId: string, request: GetResourceExportTaskRequest): GetResourceExportTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getResourceExportTaskWithOptions(exportTaskId, request, headers, runtime);
}

model GetTaskResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='C24C498A-09CF-54D3-8972-8DC074CF8614'),
  task?: {
    autoApply?: boolean(name='autoApply', example='true'),
    autoDestroy?: boolean(name='autoDestroy', example='false'),
    createTime?: string(name='createTime', example='2022-06-15T02:44:37Z'),
    currentJobId?: string(name='currentJobId', example='job-absdf'),
    description?: string(name='description', example='demo'),
    groupInfo?: {
      groupId?: string(name='groupId', example='g-59d8d22e78792ffe3d3eb6154d727'),
      groupName?: string(name='groupName', example='abc'),
      projectId?: string(name='projectId', example='p-433aead756057fff47ecbfd94d76'),
      projectName?: string(name='projectName', example='abc'),
    }(name='groupInfo'),
    initModuleState?: boolean(name='initModuleState'),
    moduleId?: string(name='moduleId', example='mod-4267dcfbf1b6d14625614ddbe15'),
    moduleVersion?: string(name='moduleVersion', example='v2'),
    name?: string(name='name'),
    parameters?: map[string]string(name='parameters'),
    protectionStrategy?: [ string ](name='protectionStrategy'),
    ramRole?: string(name='ramRole', example='{}'),
    skipPropertyValidation?: boolean(name='skipPropertyValidation'),
    status?: string(name='status', example='Running'),
    taskId?: string(name='taskId', example='task-433aead756057154bda7f1c2e98'),
    taskOutputPath?: string(name='taskOutputPath', example='/'),
    terraformVersion?: string(name='terraformVersion', example='1.2.6'),
    triggerStrategy?: string(name='triggerStrategy', example='Manual'),
    triggerValue?: string(name='triggerValue', example='***10*'),
  }(name='task'),
}

model GetTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTaskResponseBody(name='body'),
}

/**
 * @summary 查询任务详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTaskResponse
 */
async function getTaskWithOptions(taskId: string, headers: map[string]string, runtime: $RuntimeOptions): GetTaskResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTask',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询任务详情
 *
 * @return GetTaskResponse
 */
async function getTask(taskId: string): GetTaskResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getTaskWithOptions(taskId, headers, runtime);
}

model GetTaskPolicyRequest {
  type?: string(name='type', example='SceneTestingTask'),
}

model GetTaskPolicyResponseBody = {
  requestId?: string(name='requestId', example='0D797DC3-FF04-5C21-81EB-92C7799512E3'),
  taskPolicy?: {
    groupId?: string(name='groupId', example='g-433aead7560571e66e31274ffd3'),
    taskPolicies?: [ 
      {
        priority?: long(name='priority', example='5'),
        taskId?: string(name='taskId', example='task-433aead7560571d0938bfbbe957'),
        taskName?: string(name='taskName'),
        type?: string(name='type', example='SceneTestingTask'),
      }
    ](name='taskPolicies'),
  }(name='taskPolicy'),
}

model GetTaskPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTaskPolicyResponseBody(name='body'),
}

/**
 * @summary 查询分组优先级详情
 *
 * @param request GetTaskPolicyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTaskPolicyResponse
 */
async function getTaskPolicyWithOptions(groupId: string, request: GetTaskPolicyRequest, headers: map[string]string, runtime: $RuntimeOptions): GetTaskPolicyResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.type)) {
    query['type'] = request.type;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetTaskPolicy',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/task/policy/${$URL.percentEncode(groupId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询分组优先级详情
 *
 * @param request GetTaskPolicyRequest
 * @return GetTaskPolicyResponse
 */
async function getTaskPolicy(groupId: string, request: GetTaskPolicyRequest): GetTaskPolicyResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return getTaskPolicyWithOptions(groupId, request, headers, runtime);
}

model ListAuthorizationsRequest {
  authorizationId?: string(name='authorizationId', example='auth-433aead756057ffec22d5b1ef27ac'),
  authorizationType?: string(name='authorizationType', description='This parameter is required.', example='others'),
  keyword?: string(name='keyword', example='key'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
}

model ListAuthorizationsResponseBody = {
  authorizations?: [ 
    {
      authorizationId?: string(name='authorizationId', example='auth-433aead756057ffee37b763564fdd'),
      createTime?: string(name='createTime', example='2022-06-16T03:41:34Z'),
      dueTime?: string(name='dueTime'),
      moduleId?: string(name='moduleId', example='mod-395f8626622affff71ccbf5b25885'),
      moduleVersion?: string(name='moduleVersion', example='v1'),
      name?: string(name='name', example='test'),
      ownerUid?: long(name='ownerUid', example='aadfaf'),
      uid?: long(name='uid', example='asdf123'),
    }
  ](name='authorizations'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='10'),
  requestId?: string(name='requestId', description='Id of the request', example='C67A913A-2A0F-53F6-A041-56CC4CA1E593'),
  totalCount?: int32(name='totalCount', example='72'),
}

model ListAuthorizationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAuthorizationsResponseBody(name='body'),
}

/**
 * @summary 获取共享列表
 *
 * @param request ListAuthorizationsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAuthorizationsResponse
 */
async function listAuthorizationsWithOptions(request: ListAuthorizationsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAuthorizationsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.authorizationId)) {
    query['authorizationId'] = request.authorizationId;
  }
  if (!$isNull(request.authorizationType)) {
    query['authorizationType'] = request.authorizationType;
  }
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAuthorizations',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/authorizations`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取共享列表
 *
 * @param request ListAuthorizationsRequest
 * @return ListAuthorizationsResponse
 */
async function listAuthorizations(request: ListAuthorizationsRequest): ListAuthorizationsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listAuthorizationsWithOptions(request, headers, runtime);
}

model ListAvailableTerraformVersionsRequest {
  keyWord?: string(name='keyWord', example='1.35'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='20'),
}

model ListAvailableTerraformVersionsResponseBody = {
  requestId?: string(name='requestId', example='b19952f6-1e03-43e3-ac9b-1be20c9ac1a6'),
  totalCount?: int32(name='totalCount', example='58'),
  verisonList?: [ string ](name='verisonList'),
}

model ListAvailableTerraformVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListAvailableTerraformVersionsResponseBody(name='body'),
}

/**
 * @summary terraform版本
 *
 * @param request ListAvailableTerraformVersionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListAvailableTerraformVersionsResponse
 */
async function listAvailableTerraformVersionsWithOptions(request: ListAvailableTerraformVersionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListAvailableTerraformVersionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyWord)) {
    query['keyWord'] = request.keyWord;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListAvailableTerraformVersions',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/version/terraform`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary terraform版本
 *
 * @param request ListAvailableTerraformVersionsRequest
 * @return ListAvailableTerraformVersionsResponse
 */
async function listAvailableTerraformVersions(request: ListAvailableTerraformVersionsRequest): ListAvailableTerraformVersionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listAvailableTerraformVersionsWithOptions(request, headers, runtime);
}

model ListExplorerTasksRequest {
  keyword?: string(name='keyword'),
  maxResult?: string(name='maxResult'),
  moduleId?: string(name='moduleId'),
  nextToken?: string(name='nextToken'),
}

model ListExplorerTasksResponseBody = {
  maxResults?: int32(name='maxResults'),
  nextToken?: string(name='nextToken'),
  requestId?: string(name='requestId'),
  tasks?: [ 
    {
      autoApply?: boolean(name='autoApply'),
      createTime?: string(name='createTime'),
      currentJobId?: string(name='currentJobId'),
      currentJobStatus?: string(name='currentJobStatus'),
      deletionProtection?: boolean(name='deletionProtection'),
      moduleId?: string(name='moduleId'),
      moduleName?: string(name='moduleName'),
      moduleVersion?: string(name='moduleVersion'),
      name?: string(name='name'),
      status?: string(name='status'),
      taskId?: string(name='taskId'),
    }
  ](name='tasks'),
  totalCount?: int32(name='totalCount'),
}

model ListExplorerTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExplorerTasksResponseBody(name='body'),
}

/**
 * @summary 列举Explorer任务
 *
 * @param request ListExplorerTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExplorerTasksResponse
 */
async function listExplorerTasksWithOptions(explorerTaskId: string, request: ListExplorerTasksRequest, headers: map[string]string, runtime: $RuntimeOptions): ListExplorerTasksResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.maxResult)) {
    query['maxResult'] = request.maxResult;
  }
  if (!$isNull(request.moduleId)) {
    query['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListExplorerTasks',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/explorerTask`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 列举Explorer任务
 *
 * @param request ListExplorerTasksRequest
 * @return ListExplorerTasksResponse
 */
async function listExplorerTasks(explorerTaskId: string, request: ListExplorerTasksRequest): ListExplorerTasksResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listExplorerTasksWithOptions(explorerTaskId, request, headers, runtime);
}

model ListGroupRequest {
  keyword?: string(name='keyword'),
  pageNumber?: string(name='pageNumber', example='1'),
  pageSize?: string(name='pageSize', example='200'),
  projectId?: string(name='projectId', example='p-14e80de4866bf7ffed0c4072ed9b37'),
  tag?: [ 
    {
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='tag'),
}

model ListGroupShrinkRequest {
  keyword?: string(name='keyword'),
  pageNumber?: string(name='pageNumber', example='1'),
  pageSize?: string(name='pageSize', example='200'),
  projectId?: string(name='projectId', example='p-14e80de4866bf7ffed0c4072ed9b37'),
  tagShrink?: string(name='tag'),
}

model ListGroupResponseBody = {
  count?: long(name='count', example='3'),
  groups?: [ 
    {
      createTime?: string(name='createTime', example='2022-09-14T07:19:13Z'),
      description?: string(name='description', example='OK'),
      groupId?: string(name='groupId', example='g-148e7853433574fffe9fec72ed9b73'),
      isDefault?: boolean(name='isDefault', example='true'),
      moduleCnt?: long(name='moduleCnt', example='1'),
      name?: string(name='name', example='1'),
      projectId?: string(name='projectId', example='p-4267dcfbf1b6d126edcadf0e949'),
      sceneTestingTaskCnt?: long(name='sceneTestingTaskCnt', example='1'),
      tags?: [ 
        {
          key?: string(name='key'),
          value?: string(name='value'),
        }
      ](name='tags'),
      taskCnt?: long(name='taskCnt', example='3'),
    }
  ](name='groups'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  requestId?: string(name='requestId', example='B6ED9F71-7FA8-598E-B64D-4606FB3FCCC9'),
}

model ListGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGroupResponseBody(name='body'),
}

/**
 * @summary 查询分组列表
 *
 * @param tmpReq ListGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGroupResponse
 */
async function listGroupWithOptions(tmpReq: ListGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): ListGroupResponse {
  tmpReq.validate();
  var request = new ListGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'tag', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.projectId)) {
    query['projectId'] = request.projectId;
  }
  if (!$isNull(request.tagShrink)) {
    query['tag'] = request.tagShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询分组列表
 *
 * @param request ListGroupRequest
 * @return ListGroupResponse
 */
async function listGroup(request: ListGroupRequest): ListGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listGroupWithOptions(request, headers, runtime);
}

model ListJobsRequest {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  status?: string(name='status', example='Errored'),
  taskType?: string(name='taskType'),
}

model ListJobsResponseBody = {
  jobs?: [ 
    {
      config?: {
        isDestroy?: boolean(name='isDestroy'),
        moduleVersion?: string(name='moduleVersion', example='v4'),
        resourcesChanged?: string(name='resourcesChanged', example='{}'),
        subCommand?: string(name='subCommand'),
      }(name='config'),
      createTime?: string(name='createTime', example='2022-07-05T02:13:43Z'),
      description?: string(name='description', example='OK'),
      elapsedTime?: long(name='elapsedTime'),
      executeType?: string(name='executeType'),
      isPassAssertCheck?: boolean(name='isPassAssertCheck', example='true'),
      jobId?: string(name='jobId', example='job-433aead756057fff9e4dca57b147c'),
      status?: string(name='status', example='Errored'),
      statusDetail?: map[string]JobsStatusDetailValue(name='statusDetail'),
      taskId?: string(name='taskId', example='task-518855d9a058c1176866c2c3efb'),
      terraformProviderVersion?: string(name='terraformProviderVersion'),
    }
  ](name='jobs'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  requestId?: string(name='requestId', example='882304F9-6DB1-5593-A719-33473D082B9C'),
  totalCount?: int32(name='totalCount', example='11'),
}

model ListJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJobsResponseBody(name='body'),
}

/**
 * @summary 作业列表
 *
 * @param request ListJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListJobsResponse
 */
async function listJobsWithOptions(taskId: string, request: ListJobsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListJobsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }
  if (!$isNull(request.taskType)) {
    query['taskType'] = request.taskType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListJobs',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 作业列表
 *
 * @param request ListJobsRequest
 * @return ListJobsResponse
 */
async function listJobs(taskId: string, request: ListJobsRequest): ListJobsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listJobsWithOptions(taskId, request, headers, runtime);
}

model ListModuleVersionRequest {
  keyword?: string(name='keyword', example='key'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
}

model ListModuleVersionResponseBody = {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  requestId?: string(name='requestId', example='792171BB-1A68-5148-8B9B-C7C728E1E98B'),
  totalCount?: int32(name='totalCount', example='6'),
  versions?: [ 
    {
      createTime?: string(name='createTime', example='2022-05-13T02:21:49Z'),
      description?: string(name='description', example='description'),
      moduleId?: string(name='moduleId', example='mod-55f1739d9050fffed3ec3a2c4a5e5'),
      moduleVersion?: string(name='moduleVersion', example='v3'),
      name?: string(name='name', example='name'),
      sourcePath?: string(name='sourcePath', example='oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/code.zip'),
    }
  ](name='versions'),
}

model ListModuleVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListModuleVersionResponseBody(name='body'),
}

/**
 * @summary 模版版本列表
 *
 * @param request ListModuleVersionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListModuleVersionResponse
 */
async function listModuleVersionWithOptions(moduleId: string, request: ListModuleVersionRequest, headers: map[string]string, runtime: $RuntimeOptions): ListModuleVersionResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListModuleVersion',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/${$URL.percentEncode(moduleId)}/versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 模版版本列表
 *
 * @param request ListModuleVersionRequest
 * @return ListModuleVersionResponse
 */
async function listModuleVersion(moduleId: string, request: ListModuleVersionRequest): ListModuleVersionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listModuleVersionWithOptions(moduleId, request, headers, runtime);
}

model ListModulesRequest {
  excludeModuleIds?: [ string ](name='excludeModuleIds'),
  groupId?: string(name='groupId'),
  keyword?: string(name='keyword', example='key'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  projectId?: string(name='projectId'),
  tag?: [ 
    {
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='tag'),
}

model ListModulesShrinkRequest {
  excludeModuleIdsShrink?: string(name='excludeModuleIds'),
  groupId?: string(name='groupId'),
  keyword?: string(name='keyword', example='key'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  projectId?: string(name='projectId'),
  tagShrink?: string(name='tag'),
}

model ListModulesResponseBody = {
  modules?: [ 
    {
      createTime?: string(name='createTime', example='2022-01-30T02:14:16Z'),
      deletionProtection?: boolean(name='deletionProtection', example='false'),
      description?: string(name='description', example='description'),
      groupInfo?: {
        groupId?: string(name='groupId'),
        groupName?: string(name='groupName'),
        projectId?: string(name='projectId'),
        projectName?: string(name='projectName'),
      }(name='groupInfo'),
      latestVersion?: string(name='latestVersion', example='v1'),
      meta?: map[string]any(name='meta'),
      moduleId?: string(name='moduleId', example='mod-518855d9a058cdbd3fd6951d59'),
      name?: string(name='name'),
      source?: string(name='source', example='OSS'),
      sourceConfig?: map[string]any(name='sourceConfig'),
      status?: string(name='status', example='Created'),
      tags?: [ 
        {
          key?: string(name='key'),
          value?: string(name='value'),
        }
      ](name='tags'),
    }
  ](name='modules'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  requestId?: string(name='requestId', example='C617E03B-3DD2-5F0C-A6CF-3028B499A2D5'),
  totalCount?: int32(name='totalCount', example='2790'),
}

model ListModulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListModulesResponseBody(name='body'),
}

/**
 * @summary 列举模版
 *
 * @param tmpReq ListModulesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListModulesResponse
 */
async function listModulesWithOptions(tmpReq: ListModulesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListModulesResponse {
  tmpReq.validate();
  var request = new ListModulesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.excludeModuleIds)) {
    request.excludeModuleIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.excludeModuleIds, 'excludeModuleIds', 'simple');
  }
  if (!$isNull(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'tag', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.excludeModuleIdsShrink)) {
    query['excludeModuleIds'] = request.excludeModuleIdsShrink;
  }
  if (!$isNull(request.groupId)) {
    query['groupId'] = request.groupId;
  }
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.projectId)) {
    query['projectId'] = request.projectId;
  }
  if (!$isNull(request.tagShrink)) {
    query['tag'] = request.tagShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListModules',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 列举模版
 *
 * @param request ListModulesRequest
 * @return ListModulesResponse
 */
async function listModules(request: ListModulesRequest): ListModulesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listModulesWithOptions(request, headers, runtime);
}

model ListParameterSetRelationRequest {
  resourceId?: string(name='resourceId', description='This parameter is required.'),
  resourceType?: string(name='resourceType', description='This parameter is required.'),
}

model ListParameterSetRelationResponseBody = {
  parameterSets?: [ 
    {
      createTime?: string(name='createTime'),
      description?: string(name='description'),
      name?: string(name='name'),
      parameterSetId?: string(name='parameterSetId'),
      parameters?: map[string]string(name='parameters'),
    }
  ](name='parameterSets'),
  requestId?: string(name='requestId'),
  totalCount?: int32(name='totalCount'),
}

model ListParameterSetRelationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListParameterSetRelationResponseBody(name='body'),
}

/**
 * @summary 关联到资源的参数集列表
 *
 * @param request ListParameterSetRelationRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListParameterSetRelationResponse
 */
async function listParameterSetRelationWithOptions(request: ListParameterSetRelationRequest, headers: map[string]string, runtime: $RuntimeOptions): ListParameterSetRelationResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.resourceId)) {
    query['resourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    query['resourceType'] = request.resourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListParameterSetRelation',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets/operations/relation`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 关联到资源的参数集列表
 *
 * @param request ListParameterSetRelationRequest
 * @return ListParameterSetRelationResponse
 */
async function listParameterSetRelation(request: ListParameterSetRelationRequest): ListParameterSetRelationResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listParameterSetRelationWithOptions(request, headers, runtime);
}

model ListParameterSetsRequest {
  keyword?: string(name='keyword', example='key'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
}

model ListParameterSetsResponseBody = {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  parameterSets?: [ 
    {
      createTime?: string(name='createTime', example='2022-05-14T10:05:19Z'),
      deletionProtection?: boolean(name='deletionProtection'),
      description?: string(name='description', example='OK'),
      name?: string(name='name', example='12'),
      parameterSetId?: string(name='parameterSetId', example='pts-433aead756057ea135b21e89c'),
      parameters?: [ 
        {
          name?: string(name='name'),
          type?: string(name='type', example='string'),
          value?: any(name='value', example='111'),
        }
      ](name='parameters'),
      relationList?: [ 
        {
          createTime?: string(name='createTime', example='2022-06-09T03:46:18Z'),
          resourceId?: string(name='resourceId', example='task-433aead756057ffdf5326bf1e12ed'),
          resourceType?: string(name='resourceType', example='Module'),
        }
      ](name='relationList'),
    }
  ](name='parameterSets'),
  requestId?: string(name='requestId', example='4E188A8C-D77A-53F2-9578-E9AD8ABF2FA9'),
  totalCount?: int32(name='totalCount', example='50'),
}

model ListParameterSetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListParameterSetsResponseBody(name='body'),
}

/**
 * @summary 参数集列表
 *
 * @param request ListParameterSetsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListParameterSetsResponse
 */
async function listParameterSetsWithOptions(request: ListParameterSetsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListParameterSetsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListParameterSets',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 参数集列表
 *
 * @param request ListParameterSetsRequest
 * @return ListParameterSetsResponse
 */
async function listParameterSets(request: ListParameterSetsRequest): ListParameterSetsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listParameterSetsWithOptions(request, headers, runtime);
}

model ListProjectRequest {
  keyword?: string(name='keyword'),
  pageNumber?: string(name='pageNumber', example='1'),
  pageSize?: string(name='pageSize', example='10'),
  tag?: [ 
    {
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='tag'),
}

model ListProjectShrinkRequest {
  keyword?: string(name='keyword'),
  pageNumber?: string(name='pageNumber', example='1'),
  pageSize?: string(name='pageSize', example='10'),
  tagShrink?: string(name='tag'),
}

model ListProjectResponseBody = {
  count?: long(name='count', example='3'),
  pageNumber?: long(name='pageNumber', example='1'),
  pageSize?: long(name='pageSize', example='10'),
  projects?: [ 
    {
      createTime?: string(name='createTime', example='2022-05-10T10:08:34Z'),
      description?: string(name='description', example='abc'),
      name?: string(name='name', example='1234'),
      projectId?: string(name='projectId', example='p-148e7853433574fffe9fec72ed9b72'),
      tags?: [ 
        {
          key?: string(name='key'),
          value?: string(name='value'),
        }
      ](name='tags'),
      taskCnt?: long(name='taskCnt', example='2'),
    }
  ](name='projects'),
  requestId?: string(name='requestId', example='136B3926-DD90-5DB2-96EC-8BAD6407D1C9'),
}

model ListProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectResponseBody(name='body'),
}

/**
 * @summary 查询项目列表
 *
 * @param tmpReq ListProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectResponse
 */
async function listProjectWithOptions(tmpReq: ListProjectRequest, headers: map[string]string, runtime: $RuntimeOptions): ListProjectResponse {
  tmpReq.validate();
  var request = new ListProjectShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'tag', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.tagShrink)) {
    query['tag'] = request.tagShrink;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListProject',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询项目列表
 *
 * @param request ListProjectRequest
 * @return ListProjectResponse
 */
async function listProject(request: ListProjectRequest): ListProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectWithOptions(request, headers, runtime);
}

model ListProjectBuildsRequest {
  groupId?: string(name='groupId'),
  pageNumber?: string(name='pageNumber'),
  pageSize?: string(name='pageSize'),
  projectBuildAction?: string(name='projectBuildAction'),
}

model ListProjectBuildsResponseBody = {
  projectBuilds?: [ 
    {
      createTime?: string(name='createTime', example='2022-08-26T02:10:48Z'),
      endTime?: string(name='endTime'),
      projectBuildAction?: string(name='projectBuildAction', example='apply'),
      projectBuildId?: string(name='projectBuildId', example='pb-433aead75605717728b6a27615f'),
      projectBuildIndex?: long(name='projectBuildIndex', example='1661221432088'),
      projectId?: string(name='projectId', example='p-14e80de4866bf7ffed0bab6154d737'),
      status?: string(name='status', example='Pending'),
      terraformProviderVersion?: string(name='terraformProviderVersion'),
      timestamp?: long(name='timestamp', example='1661221432088'),
      triggerStrategy?: string(name='triggerStrategy'),
    }
  ](name='ProjectBuilds'),
  pageNumber?: long(name='pageNumber'),
  pageSize?: long(name='pageSize'),
  requestId?: string(name='requestId', description='Id of the request', example='89154E16-FB0A-573D-8AF5-CF3F2FE28913'),
  totalCount?: int32(name='totalCount', example='15'),
}

model ListProjectBuildsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectBuildsResponseBody(name='body'),
}

/**
 * @summary 项目批次列表
 *
 * @param request ListProjectBuildsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectBuildsResponse
 */
async function listProjectBuildsWithOptions(projectId: string, request: ListProjectBuildsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListProjectBuildsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.groupId)) {
    query['groupId'] = request.groupId;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.projectBuildAction)) {
    query['projectBuildAction'] = request.projectBuildAction;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListProjectBuilds',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}/build`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 项目批次列表
 *
 * @param request ListProjectBuildsRequest
 * @return ListProjectBuildsResponse
 */
async function listProjectBuilds(projectId: string, request: ListProjectBuildsRequest): ListProjectBuildsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectBuildsWithOptions(projectId, request, headers, runtime);
}

model ListRabbitmqPublishersRequest {
  keyword?: string(name='keyword', example='key'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
}

model ListRabbitmqPublishersResponseBody = {
  authorizations?: [ 
    {
      createTime?: string(name='createTime', example='2022-06-16T03:41:34Z'),
      description?: string(name='description', example='description'),
      exchangeName?: string(name='exchangeName', example='exchangeName'),
      exchangeType?: string(name='exchangeType', example='TOPIC'),
      hostName?: string(name='hostName'),
      name?: string(name='name', example='MQ'),
      port?: long(name='port', example='5671'),
      publisherId?: string(name='publisherId', example='mqp-3b6cb9fa4751a6e5cd2682246'),
      userName?: string(name='userName', example='MjoxODgwNzcwODY5MD***'),
      virtualHost?: string(name='virtualHost', example='virtualHost'),
    }
  ](name='authorizations'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  requestId?: string(name='requestId', example='6599600A-20F6-556D-A15C-55EB9243BB24'),
  totalCount?: int32(name='totalCount', example='72'),
}

model ListRabbitmqPublishersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRabbitmqPublishersResponseBody(name='body'),
}

/**
 * @summary 获取消息发布者列表
 *
 * @param request ListRabbitmqPublishersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRabbitmqPublishersResponse
 */
async function listRabbitmqPublishersWithOptions(request: ListRabbitmqPublishersRequest, headers: map[string]string, runtime: $RuntimeOptions): ListRabbitmqPublishersResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRabbitmqPublishers',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取消息发布者列表
 *
 * @param request ListRabbitmqPublishersRequest
 * @return ListRabbitmqPublishersResponse
 */
async function listRabbitmqPublishers(request: ListRabbitmqPublishersRequest): ListRabbitmqPublishersResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listRabbitmqPublishersWithOptions(request, headers, runtime);
}

model ListRamPolicyExportTaskVersionsRequest {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  status?: string(name='status', example='Success'),
}

model ListRamPolicyExportTaskVersionsResponseBody = {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  ramPolicyExportTaskVersions?: [ 
    {
      createTime?: string(name='createTime', example='2022-07-04T02:11:29Z'),
      elapsedTime?: long(name='elapsedTime'),
      exportVersion?: string(name='exportVersion', example='v1'),
      moduleId?: string(name='moduleId', example='mod-51da8a8a36c166'),
      moduleVersion?: string(name='moduleVersion', example='v1'),
      ramPolicyExportTaskId?: string(name='ramPolicyExportTaskId', example='rpe-437ffe0252e48f9286a'),
      status?: string(name='status', example='Success'),
    }
  ](name='ramPolicyExportTaskVersions'),
  requestId?: string(name='requestId', example='E2D0E863-1651-5E58-823F-B451C8C24615'),
  totalCount?: int32(name='totalCount', example='50'),
}

model ListRamPolicyExportTaskVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRamPolicyExportTaskVersionsResponseBody(name='body'),
}

/**
 * @summary 获取RAM策略导出任务版本列表
 *
 * @param request ListRamPolicyExportTaskVersionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRamPolicyExportTaskVersionsResponse
 */
async function listRamPolicyExportTaskVersionsWithOptions(ramPolicyExportTaskId: string, request: ListRamPolicyExportTaskVersionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListRamPolicyExportTaskVersionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRamPolicyExportTaskVersions',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}/versions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取RAM策略导出任务版本列表
 *
 * @param request ListRamPolicyExportTaskVersionsRequest
 * @return ListRamPolicyExportTaskVersionsResponse
 */
async function listRamPolicyExportTaskVersions(ramPolicyExportTaskId: string, request: ListRamPolicyExportTaskVersionsRequest): ListRamPolicyExportTaskVersionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listRamPolicyExportTaskVersionsWithOptions(ramPolicyExportTaskId, request, headers, runtime);
}

model ListRamPolicyExportTasksRequest {
  keyword?: string(name='keyword', example='vpc'),
  moduleId?: string(name='moduleId', example='mod-43143bd9145a5258'),
  moduleVersion?: string(name='moduleVersion'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
}

model ListRamPolicyExportTasksResponseBody = {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  ramPolicyExportTasks?: [ 
    {
      createTime?: string(name='createTime', example='2022-09-16T03:59:27Z'),
      currentPolicyStatus?: string(name='currentPolicyStatus'),
      currentPolicyVersion?: string(name='currentPolicyVersion'),
      elapsedTime?: long(name='elapsedTime'),
      exportTime?: string(name='exportTime'),
      moduleId?: string(name='moduleId', example='mod-51fdfefa8788e82c9'),
      moduleVersion?: string(name='moduleVersion', example='v1'),
      name?: string(name='name', example='test'),
      ramPolicyExportTaskId?: string(name='ramPolicyExportTaskId', example='rpe-457ffe0252e48f9286a'),
      status?: string(name='status', example='Available'),
      taskOutputPath?: string(name='taskOutputPath', example='12345678/default/rampolicytask/rpe-4399111870d7e6b0f11a'),
    }
  ](name='ramPolicyExportTasks'),
  requestId?: string(name='requestId', example='B6ED9F71-7FA8-598E-B64D-4606FB3FCCC9'),
  totalCount?: int32(name='totalCount', example='43'),
}

model ListRamPolicyExportTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListRamPolicyExportTasksResponseBody(name='body'),
}

/**
 * @summary 获取RAM策略导出任务列表
 *
 * @param request ListRamPolicyExportTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListRamPolicyExportTasksResponse
 */
async function listRamPolicyExportTasksWithOptions(request: ListRamPolicyExportTasksRequest, headers: map[string]string, runtime: $RuntimeOptions): ListRamPolicyExportTasksResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.moduleId)) {
    query['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    query['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListRamPolicyExportTasks',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取RAM策略导出任务列表
 *
 * @param request ListRamPolicyExportTasksRequest
 * @return ListRamPolicyExportTasksResponse
 */
async function listRamPolicyExportTasks(request: ListRamPolicyExportTasksRequest): ListRamPolicyExportTasksResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listRamPolicyExportTasksWithOptions(request, headers, runtime);
}

model ListResourceExportTaskVersionsRequest {
  exportVersion?: string(name='exportVersion'),
  keyword?: string(name='keyword'),
  pageNumber?: int32(name='pageNumber'),
  pageSize?: int32(name='pageSize'),
  status?: string(name='status'),
}

model ListResourceExportTaskVersionsResponseBody = {
  exportTasks?: [ 
    {
      createTime?: string(name='createTime'),
      description?: string(name='description'),
      elapsedTime?: long(name='elapsedTime'),
      excludeRules?: [ 
        {
          key?: string(name='key'),
          values?: [ string ](name='values'),
        }
      ](name='excludeRules'),
      exportTaskId?: string(name='exportTaskId'),
      exportToModule?: {
        source?: string(name='source'),
        sourcePath?: string(name='sourcePath'),
        statePath?: string(name='statePath'),
      }(name='exportToModule'),
      exportVersion?: string(name='exportVersion'),
      failedReason?: string(name='failedReason'),
      hasDestroy?: boolean(name='hasDestroy'),
      includeRules?: [ 
        {
          key?: string(name='key'),
          values?: [ string ](name='values'),
        }
      ](name='includeRules'),
      modules?: [ 
        {
          source?: string(name='source'),
          sourcePath?: string(name='sourcePath'),
          version?: string(name='version'),
        }
      ](name='modules'),
      name?: string(name='name'),
      status?: string(name='status'),
      variables?: [ 
        {
          properties?: [ string ](name='properties'),
          resourceType?: string(name='resourceType'),
        }
      ](name='variables'),
    }
  ](name='exportTasks'),
  pageNumber?: int32(name='pageNumber'),
  pageSize?: int32(name='pageSize'),
  requestId?: string(name='requestId'),
  totalCount?: int32(name='totalCount'),
}

model ListResourceExportTaskVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceExportTaskVersionsResponseBody(name='body'),
}

/**
 * @summary 获取任务版本列表
 *
 * @param request ListResourceExportTaskVersionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceExportTaskVersionsResponse
 */
async function listResourceExportTaskVersionsWithOptions(exportTaskId: string, request: ListResourceExportTaskVersionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListResourceExportTaskVersionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.exportVersion)) {
    query['exportVersion'] = request.exportVersion;
  }
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListResourceExportTaskVersions',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/${$URL.percentEncode(exportTaskId)}/exportVersions`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取任务版本列表
 *
 * @param request ListResourceExportTaskVersionsRequest
 * @return ListResourceExportTaskVersionsResponse
 */
async function listResourceExportTaskVersions(exportTaskId: string, request: ListResourceExportTaskVersionsRequest): ListResourceExportTaskVersionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listResourceExportTaskVersionsWithOptions(exportTaskId, request, headers, runtime);
}

model ListResourceExportTasksRequest {
  exportTaskId?: string(name='exportTaskId'),
  keyword?: string(name='keyword'),
  pageNumber?: int32(name='pageNumber'),
  pageSize?: int32(name='pageSize'),
}

model ListResourceExportTasksResponseBody = {
  exportTasks?: [ 
    {
      createTime?: string(name='createTime'),
      description?: string(name='description'),
      elapsedTime?: long(name='elapsedTime'),
      excludeRules?: [ 
        {
          key?: string(name='key'),
          values?: [ string ](name='values'),
        }
      ](name='excludeRules'),
      exportStatus?: string(name='exportStatus'),
      exportTaskId?: string(name='exportTaskId'),
      exportToModule?: {
        source?: string(name='source'),
        sourcePath?: string(name='sourcePath'),
        statePath?: string(name='statePath'),
      }(name='exportToModule'),
      exportVersion?: string(name='exportVersion'),
      hasDestroy?: boolean(name='hasDestroy'),
      includeRules?: [ 
        {
          key?: string(name='key'),
          values?: [ string ](name='values'),
        }
      ](name='includeRules'),
      modules?: [ 
        {
          source?: string(name='source'),
          sourcePath?: string(name='sourcePath'),
          version?: string(name='version'),
        }
      ](name='modules'),
      name?: string(name='name'),
      status?: string(name='status'),
      variables?: [ 
        {
          properties?: [ string ](name='properties'),
          resourceType?: string(name='resourceType'),
        }
      ](name='variables'),
    }
  ](name='exportTasks'),
  pageNumber?: int32(name='pageNumber'),
  pageSize?: int32(name='pageSize'),
  requestId?: string(name='requestId'),
  totalCount?: int32(name='totalCount'),
}

model ListResourceExportTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceExportTasksResponseBody(name='body'),
}

/**
 * @summary 查询导出任务列表
 *
 * @param request ListResourceExportTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceExportTasksResponse
 */
async function listResourceExportTasksWithOptions(request: ListResourceExportTasksRequest, headers: map[string]string, runtime: $RuntimeOptions): ListResourceExportTasksResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.exportTaskId)) {
    query['exportTaskId'] = request.exportTaskId;
  }
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListResourceExportTasks',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询导出任务列表
 *
 * @param request ListResourceExportTasksRequest
 * @return ListResourceExportTasksResponse
 */
async function listResourceExportTasks(request: ListResourceExportTasksRequest): ListResourceExportTasksResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listResourceExportTasksWithOptions(request, headers, runtime);
}

model ListResourcesRequest {
  pageNumber?: int32(name='pageNumber'),
  pageSize?: int32(name='pageSize'),
  sourceType?: string(name='sourceType', description='This parameter is required.'),
  sourceValue?: string(name='sourceValue', description='This parameter is required.'),
  specType?: string(name='specType', description='This parameter is required.'),
}

model ListResourcesResponseBody = {
  resources?: [ 
    {
      accountId?: string(name='accountId'),
      createTime?: string(name='createTime'),
      dependsOnResourceIds?: [ string ](name='dependsOnResourceIds'),
      productCode?: string(name='productCode'),
      properties?: map[string]any(name='properties'),
      propertyVariables?: map[string]any(name='propertyVariables'),
      regionId?: string(name='regionId'),
      resourceArn?: string(name='resourceArn'),
      resourceGroupId?: string(name='resourceGroupId'),
      resourceId?: string(name='resourceId'),
      resourceName?: string(name='resourceName'),
      resourceType?: string(name='resourceType'),
      status?: string(name='status'),
      tags?: [ 
        {
          tagKey?: string(name='tagKey'),
          tagValue?: string(name='tagValue'),
        }
      ](name='tags'),
      terraformArn?: string(name='terraformArn'),
      terraformCode?: string(name='terraformCode'),
      zoneId?: string(name='zoneId'),
    }
  ](name='Resources'),
  pageNumber?: int32(name='pageNumber'),
  pageSize?: int32(name='pageSize'),
  requestId?: string(name='requestId'),
  totalCount?: int32(name='totalCount'),
}

model ListResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourcesResponseBody(name='body'),
}

/**
 * @summary 资源列表
 *
 * @param request ListResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourcesResponse
 */
async function listResourcesWithOptions(request: ListResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): ListResourcesResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.sourceType)) {
    query['sourceType'] = request.sourceType;
  }
  if (!$isNull(request.sourceValue)) {
    query['sourceValue'] = request.sourceValue;
  }
  if (!$isNull(request.specType)) {
    query['specType'] = request.specType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListResources',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/resources/stateparser`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 资源列表
 *
 * @param request ListResourcesRequest
 * @return ListResourcesResponse
 */
async function listResources(request: ListResourcesRequest): ListResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listResourcesWithOptions(request, headers, runtime);
}

model ListTasksRequest {
  excludeTaskIds?: [ string ](name='excludeTaskIds'),
  groupId?: string(name='groupId', example='g-59d8d22e78792ffe3d3eb6154d727'),
  keyword?: string(name='keyword', example='key'),
  moduleId?: string(name='moduleId', example='mod-1525e992f1b62139d1c437d64ae'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  projectId?: string(name='projectId', example='p-433aead7560572f8d95b25775c'),
  status?: string(name='status'),
  tag?: [ 
    {
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='tag'),
  taskId?: string(name='taskId', example='task-433aead756057fffeaba4828f5195'),
}

model ListTasksShrinkRequest {
  excludeTaskIdsShrink?: string(name='excludeTaskIds'),
  groupId?: string(name='groupId', example='g-59d8d22e78792ffe3d3eb6154d727'),
  keyword?: string(name='keyword', example='key'),
  moduleId?: string(name='moduleId', example='mod-1525e992f1b62139d1c437d64ae'),
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  projectId?: string(name='projectId', example='p-433aead7560572f8d95b25775c'),
  status?: string(name='status'),
  tagShrink?: string(name='tag'),
  taskId?: string(name='taskId', example='task-433aead756057fffeaba4828f5195'),
}

model ListTasksResponseBody = {
  pageNumber?: int32(name='pageNumber', example='1'),
  pageSize?: int32(name='pageSize', example='20'),
  requestId?: string(name='requestId', example='98610149-488B-5E48-B981-8D4CE1AF77CD'),
  tasks?: [ 
    {
      autoApply?: boolean(name='autoApply'),
      createTime?: string(name='createTime', example='2022-07-11T15:09:53Z'),
      currentJobId?: string(name='currentJobId', example='job-123asd'),
      currentJobStatus?: string(name='currentJobStatus', example='Pending'),
      deletionProtection?: boolean(name='deletionProtection'),
      groupInfo?: {
        groupId?: string(name='groupId', example='g-4267dcfbf1b6d1e0652bfbbe995'),
        groupName?: string(name='groupName', example='abc'),
        projectId?: string(name='projectId', example='p-433aead7560571cf1b2bfbbe92b'),
        projectName?: string(name='projectName', example='abc'),
      }(name='groupInfo'),
      moduleId?: string(name='moduleId', example='mod-518855d9a058c331e9c60bc0ce'),
      moduleName?: string(name='moduleName'),
      moduleVersion?: string(name='moduleVersion', example='v1'),
      name?: string(name='name', example='abc'),
      status?: string(name='status', example='Running'),
      tags?: [ 
        {
          key?: string(name='key'),
          value?: string(name='value'),
        }
      ](name='tags'),
      taskId?: string(name='taskId', example='task-1525e992f1b621b0ca51647876e'),
    }
  ](name='tasks'),
  totalCount?: int32(name='totalCount', example='5'),
}

model ListTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTasksResponseBody(name='body'),
}

/**
 * @summary 任务列表
 *
 * @param tmpReq ListTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTasksResponse
 */
async function listTasksWithOptions(tmpReq: ListTasksRequest, headers: map[string]string, runtime: $RuntimeOptions): ListTasksResponse {
  tmpReq.validate();
  var request = new ListTasksShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.excludeTaskIds)) {
    request.excludeTaskIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.excludeTaskIds, 'excludeTaskIds', 'simple');
  }
  if (!$isNull(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'tag', 'json');
  }
  var query : map[string]any = {};
  if (!$isNull(request.excludeTaskIdsShrink)) {
    query['excludeTaskIds'] = request.excludeTaskIdsShrink;
  }
  if (!$isNull(request.groupId)) {
    query['groupId'] = request.groupId;
  }
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.moduleId)) {
    query['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.pageNumber)) {
    query['pageNumber'] = request.pageNumber;
  }
  if (!$isNull(request.pageSize)) {
    query['pageSize'] = request.pageSize;
  }
  if (!$isNull(request.projectId)) {
    query['projectId'] = request.projectId;
  }
  if (!$isNull(request.status)) {
    query['status'] = request.status;
  }
  if (!$isNull(request.tagShrink)) {
    query['tag'] = request.tagShrink;
  }
  if (!$isNull(request.taskId)) {
    query['taskId'] = request.taskId;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTasks',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 任务列表
 *
 * @param request ListTasksRequest
 * @return ListTasksResponse
 */
async function listTasks(request: ListTasksRequest): ListTasksResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listTasksWithOptions(request, headers, runtime);
}

model ListTerraformProviderVersionsRequest {
  keyword?: string(name='keyword'),
  maxResults?: int32(name='maxResults'),
  nextToken?: string(name='nextToken'),
  usage?: string(name='usage'),
}

model ListTerraformProviderVersionsResponseBody = {
  maxResults?: int32(name='maxResults'),
  nextToken?: string(name='nextToken'),
  requestId?: string(name='requestId', example='73588ebb-9d40-4660-a59f-764636ae6034'),
  totalCount?: int32(name='totalCount', example='50'),
  verisonList?: [ string ](name='verisonList'),
  versions?: [ 
    {
      publishedTime?: string(name='publishedTime'),
      status?: string(name='status'),
      version?: string(name='version'),
    }
  ](name='versions'),
}

model ListTerraformProviderVersionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTerraformProviderVersionsResponseBody(name='body'),
}

/**
 * @summary terraformProvider版本
 *
 * @param request ListTerraformProviderVersionsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTerraformProviderVersionsResponse
 */
async function listTerraformProviderVersionsWithOptions(request: ListTerraformProviderVersionsRequest, headers: map[string]string, runtime: $RuntimeOptions): ListTerraformProviderVersionsResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.keyword)) {
    query['keyword'] = request.keyword;
  }
  if (!$isNull(request.maxResults)) {
    query['maxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['nextToken'] = request.nextToken;
  }
  if (!$isNull(request.usage)) {
    query['usage'] = request.usage;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTerraformProviderVersions',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/version/terraform/provider`,
    method = 'GET',
    authType = 'Anonymous',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary terraformProvider版本
 *
 * @param request ListTerraformProviderVersionsRequest
 * @return ListTerraformProviderVersionsResponse
 */
async function listTerraformProviderVersions(request: ListTerraformProviderVersionsRequest): ListTerraformProviderVersionsResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return listTerraformProviderVersionsWithOptions(request, headers, runtime);
}

model OperateJobRequest {
  comment?: string(name='comment', description='This parameter is required.', example='dasd'),
  taskType?: string(name='taskType'),
}

model OperateJobResponseBody = {
  requestId?: string(name='requestId', example='E602681C-A811-5787-9DC3-48BED7537071'),
}

model OperateJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateJobResponseBody(name='body'),
}

/**
 * @summary 控制作业
 *
 * @param request OperateJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateJobResponse
 */
async function operateJobWithOptions(taskId: string, jobId: string, operationType: string, request: OperateJobRequest, headers: map[string]string, runtime: $RuntimeOptions): OperateJobResponse {
  request.validate();
  var query : map[string]any = {};
  if (!$isNull(request.comment)) {
    query['comment'] = request.comment;
  }
  if (!$isNull(request.taskType)) {
    query['taskType'] = request.taskType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'OperateJob',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}/jobs/${$URL.percentEncode(jobId)}/operation/${$URL.percentEncode(operationType)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 控制作业
 *
 * @param request OperateJobRequest
 * @return OperateJobResponse
 */
async function operateJob(taskId: string, jobId: string, operationType: string, request: OperateJobRequest): OperateJobResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return operateJobWithOptions(taskId, jobId, operationType, request, headers, runtime);
}

model RemoveResourceExportTaskVersionResponseBody = {
  requestId?: string(name='requestId', example='BF72A6FB-B071-5F2E-A036-9D62545B962C'),
}

model RemoveResourceExportTaskVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveResourceExportTaskVersionResponseBody(name='body'),
}

/**
 * @summary 移除导出任务版本
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveResourceExportTaskVersionResponse
 */
async function removeResourceExportTaskVersionWithOptions(exportTaskId: string, exportVersion: string, headers: map[string]string, runtime: $RuntimeOptions): RemoveResourceExportTaskVersionResponse {
  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveResourceExportTaskVersion',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/${$URL.percentEncode(exportTaskId)}/${$URL.percentEncode(exportVersion)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 移除导出任务版本
 *
 * @return RemoveResourceExportTaskVersionResponse
 */
async function removeResourceExportTaskVersion(exportTaskId: string, exportVersion: string): RemoveResourceExportTaskVersionResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return removeResourceExportTaskVersionWithOptions(exportTaskId, exportVersion, headers, runtime);
}

model TagResourcesRequest {
  regionId?: string(name='regionId', description='This parameter is required.'),
  resourceIds?: [ string ](name='resourceIds', description='This parameter is required.'),
  resourceType?: string(name='resourceType', description='This parameter is required.'),
  tags?: [ 
    {
      key?: string(name='key'),
      value?: string(name='value'),
    }
  ](name='tags', description='This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary 打标签接口
 *
 * @param request TagResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, headers: map[string]string, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.regionId)) {
    body['regionId'] = request.regionId;
  }
  if (!$isNull(request.resourceIds)) {
    body['resourceIds'] = request.resourceIds;
  }
  if (!$isNull(request.resourceType)) {
    body['resourceType'] = request.resourceType;
  }
  if (!$isNull(request.tags)) {
    body['tags'] = request.tags;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tags`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 打标签接口
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return tagResourcesWithOptions(request, headers, runtime);
}

model UpdateAuthorizationAttributeRequest {
  dueTime?: string(name='dueTime', description='This parameter is required.'),
  name?: string(name='name', description='This parameter is required.', example='test'),
}

model UpdateAuthorizationAttributeResponseBody = {
  requestId?: string(name='requestId', description='Id of the request', example='712C87FE-7C24-5298-B3E3-2BCB7AB9ED01'),
}

model UpdateAuthorizationAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateAuthorizationAttributeResponseBody(name='body'),
}

/**
 * @summary 更新共享
 *
 * @param request UpdateAuthorizationAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateAuthorizationAttributeResponse
 */
async function updateAuthorizationAttributeWithOptions(authorizationId: string, request: UpdateAuthorizationAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateAuthorizationAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.dueTime)) {
    body['dueTime'] = request.dueTime;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAuthorizationAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/authorizations/${$URL.percentEncode(authorizationId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新共享
 *
 * @param request UpdateAuthorizationAttributeRequest
 * @return UpdateAuthorizationAttributeResponse
 */
async function updateAuthorizationAttribute(authorizationId: string, request: UpdateAuthorizationAttributeRequest): UpdateAuthorizationAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateAuthorizationAttributeWithOptions(authorizationId, request, headers, runtime);
}

model UpdateExplorerTaskAttributeRequest {
  autoApply?: boolean(name='autoApply'),
  explorerTaskName?: string(name='explorerTaskName'),
  moduleId?: string(name='moduleId'),
  moduleVersion?: string(name='moduleVersion'),
  terraformProviderVersion?: string(name='terraformProviderVersion'),
}

model UpdateExplorerTaskAttributeResponseBody = {
  requestId?: string(name='requestId'),
}

model UpdateExplorerTaskAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExplorerTaskAttributeResponseBody(name='body'),
}

/**
 * @summary 修改Explorer任务
 *
 * @param request UpdateExplorerTaskAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExplorerTaskAttributeResponse
 */
async function updateExplorerTaskAttributeWithOptions(explorerTaskId: string, request: UpdateExplorerTaskAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateExplorerTaskAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoApply)) {
    body['autoApply'] = request.autoApply;
  }
  if (!$isNull(request.explorerTaskName)) {
    body['explorerTaskName'] = request.explorerTaskName;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateExplorerTaskAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/explorerTask/${$URL.percentEncode(explorerTaskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改Explorer任务
 *
 * @param request UpdateExplorerTaskAttributeRequest
 * @return UpdateExplorerTaskAttributeResponse
 */
async function updateExplorerTaskAttribute(explorerTaskId: string, request: UpdateExplorerTaskAttributeRequest): UpdateExplorerTaskAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExplorerTaskAttributeWithOptions(explorerTaskId, request, headers, runtime);
}

model UpdateGroupRequest {
  autoDestroy?: boolean(name='autoDestroy', example='true'),
  autoTrigger?: boolean(name='autoTrigger', example='true'),
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  forcedSetting?: boolean(name='forcedSetting', example='true'),
  name?: string(name='name', example='test'),
  notifyConfig?: [ 
    {
      notifyPath?: string(name='notifyPath', example='/'),
      notifyType?: string(name='notifyType', example='DingDing'),
    }
  ](name='notifyConfig'),
  notifyOperationTypes?: [ string ](name='notifyOperationTypes'),
  ramRole?: string(name='ramRole', example='{}'),
  reportExportField?: [ string ](name='reportExportField'),
  reportExportPath?: string(name='reportExportPath', example='/'),
  terraformProviderVersion?: string(name='terraformProviderVersion', example='1.183.0'),
  triggerConfig?: [ 
    {
      triggerStrategy?: string(name='triggerStrategy', example='Cron'),
      triggerValue?: string(name='triggerValue', example='0 0 * * * ？'),
    }
  ](name='triggerConfig'),
  triggerResourceType?: [ string ](name='triggerResourceType'),
}

model UpdateGroupResponseBody = {
  requestId?: string(name='requestId', example='4EF5E823-AC0D-5CB5-8F18-1352455A488D'),
}

model UpdateGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateGroupResponseBody(name='body'),
}

/**
 * @summary 修改分组
 *
 * @param request UpdateGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateGroupResponse
 */
async function updateGroupWithOptions(groupId: string, request: UpdateGroupRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoDestroy)) {
    body['autoDestroy'] = request.autoDestroy;
  }
  if (!$isNull(request.autoTrigger)) {
    body['autoTrigger'] = request.autoTrigger;
  }
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.forcedSetting)) {
    body['forcedSetting'] = request.forcedSetting;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.notifyConfig)) {
    body['notifyConfig'] = request.notifyConfig;
  }
  if (!$isNull(request.notifyOperationTypes)) {
    body['notifyOperationTypes'] = request.notifyOperationTypes;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.reportExportField)) {
    body['reportExportField'] = request.reportExportField;
  }
  if (!$isNull(request.reportExportPath)) {
    body['reportExportPath'] = request.reportExportPath;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }
  if (!$isNull(request.triggerConfig)) {
    body['triggerConfig'] = request.triggerConfig;
  }
  if (!$isNull(request.triggerResourceType)) {
    body['triggerResourceType'] = request.triggerResourceType;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateGroup',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/${$URL.percentEncode(groupId)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改分组
 *
 * @param request UpdateGroupRequest
 * @return UpdateGroupResponse
 */
async function updateGroup(groupId: string, request: UpdateGroupRequest): UpdateGroupResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateGroupWithOptions(groupId, request, headers, runtime);
}

model UpdateModuleAttributeRequest {
  description?: string(name='description', example='test'),
  groupInfo?: {
    groupId?: string(name='groupId'),
    projectId?: string(name='projectId'),
  }(name='groupInfo'),
  name?: string(name='name', example='test'),
  source?: string(name='source', example='OSS'),
  sourcePath?: string(name='sourcePath', example='OSS：
"oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/code.zip"
Registry：
"alibaba/security-group/alicloud:2.1.0"'),
  statePath?: string(name='statePath', example='oss::https://terraform-pipeline.oss-eu-central-1.aliyuncs.com/terraform.tfstate'),
  versionStrategy?: string(name='versionStrategy', example='Manual'),
}

model UpdateModuleAttributeResponseBody = {
  requestId?: string(name='requestId', example='CA05185E-6B90-5941-98D4-7212688AECC8'),
}

model UpdateModuleAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateModuleAttributeResponseBody(name='body'),
}

/**
 * @summary 更新模版
 *
 * @param request UpdateModuleAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateModuleAttributeResponse
 */
async function updateModuleAttributeWithOptions(moduleId: string, request: UpdateModuleAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateModuleAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.groupInfo)) {
    body['groupInfo'] = request.groupInfo;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.source)) {
    body['source'] = request.source;
  }
  if (!$isNull(request.sourcePath)) {
    body['sourcePath'] = request.sourcePath;
  }
  if (!$isNull(request.statePath)) {
    body['statePath'] = request.statePath;
  }
  if (!$isNull(request.versionStrategy)) {
    body['versionStrategy'] = request.versionStrategy;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateModuleAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/modules/${$URL.percentEncode(moduleId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新模版
 *
 * @param request UpdateModuleAttributeRequest
 * @return UpdateModuleAttributeResponse
 */
async function updateModuleAttribute(moduleId: string, request: UpdateModuleAttributeRequest): UpdateModuleAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateModuleAttributeWithOptions(moduleId, request, headers, runtime);
}

model UpdateParameterSetAttributeRequest {
  description?: string(name='description', example='test'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  parameters?: [ 
    {
      name?: string(name='name', example='t'),
      type?: string(name='type', example='string'),
      value?: string(name='value', example='vpc-bp1mjm9exduos1bipw9x6'),
    }
  ](name='parameters'),
}

model UpdateParameterSetAttributeResponseBody = {
  requestId?: string(name='requestId', example='81CF7E18-D318-5670-9A4D-C08476BC4899'),
}

model UpdateParameterSetAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateParameterSetAttributeResponseBody(name='body'),
}

/**
 * @summary 更新参数集
 *
 * @param request UpdateParameterSetAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateParameterSetAttributeResponse
 */
async function updateParameterSetAttributeWithOptions(parameterSetId: string, request: UpdateParameterSetAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateParameterSetAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.parameters)) {
    body['parameters'] = request.parameters;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateParameterSetAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/parameterSets/${$URL.percentEncode(parameterSetId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新参数集
 *
 * @param request UpdateParameterSetAttributeRequest
 * @return UpdateParameterSetAttributeResponse
 */
async function updateParameterSetAttribute(parameterSetId: string, request: UpdateParameterSetAttributeRequest): UpdateParameterSetAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateParameterSetAttributeWithOptions(parameterSetId, request, headers, runtime);
}

model UpdateProjectRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  description?: string(name='description', example='test'),
  name?: string(name='name', example='test'),
}

model UpdateProjectResponseBody = {
  requestId?: string(name='requestId', example='C62888F6-254D-5589-BF05-0D9EE698C187'),
}

model UpdateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectResponseBody(name='body'),
}

/**
 * @summary 修改项目
 *
 * @param request UpdateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectResponse
 */
async function updateProjectWithOptions(projectId: string, request: UpdateProjectRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateProjectResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateProject',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/project/${$URL.percentEncode(projectId)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改项目
 *
 * @param request UpdateProjectRequest
 * @return UpdateProjectResponse
 */
async function updateProject(projectId: string, request: UpdateProjectRequest): UpdateProjectResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectWithOptions(projectId, request, headers, runtime);
}

model UpdateRabbitmqPublisherAttributeRequest {
  description?: string(name='description', example='test'),
  exchangeName?: string(name='exchangeName', example='ExchangeTest'),
  exchangeType?: string(name='exchangeType', example='TOPIC'),
  name?: string(name='name', description='This parameter is required.'),
}

model UpdateRabbitmqPublisherAttributeResponseBody = {
  requestId?: string(name='requestId', example='E2D0E863-1651-5E58-823F-B451C8C24615'),
}

model UpdateRabbitmqPublisherAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRabbitmqPublisherAttributeResponseBody(name='body'),
}

/**
 * @summary 更新消息发布者
 *
 * @param request UpdateRabbitmqPublisherAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRabbitmqPublisherAttributeResponse
 */
async function updateRabbitmqPublisherAttributeWithOptions(publisherId: string, request: UpdateRabbitmqPublisherAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateRabbitmqPublisherAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.exchangeName)) {
    body['exchangeName'] = request.exchangeName;
  }
  if (!$isNull(request.exchangeType)) {
    body['exchangeType'] = request.exchangeType;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateRabbitmqPublisherAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/publishers/${$URL.percentEncode(publisherId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新消息发布者
 *
 * @param request UpdateRabbitmqPublisherAttributeRequest
 * @return UpdateRabbitmqPublisherAttributeResponse
 */
async function updateRabbitmqPublisherAttribute(publisherId: string, request: UpdateRabbitmqPublisherAttributeRequest): UpdateRabbitmqPublisherAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateRabbitmqPublisherAttributeWithOptions(publisherId, request, headers, runtime);
}

model UpdateRamPolicyExportTaskAttributeRequest {
  authorizationAccountIds?: [ long ](name='authorizationAccountIds'),
  authorizationActions?: [ string ](name='authorizationActions'),
  authorizationRegionIds?: [ string ](name='authorizationRegionIds'),
  moduleId?: string(name='moduleId', description='This parameter is required.', example='mod-143574fff6b316f4eb737e'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.', example='v1'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  ramRole?: string(name='ramRole', example='ramName'),
  triggerStrategy?: string(name='triggerStrategy', example='Auto'),
}

model UpdateRamPolicyExportTaskAttributeResponseBody = {
  requestId?: string(name='requestId', example='BF72A6FB-B071-5F2E-A036-9D62545B962C'),
}

model UpdateRamPolicyExportTaskAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateRamPolicyExportTaskAttributeResponseBody(name='body'),
}

/**
 * @summary 修改RAM策略导出任务
 *
 * @param request UpdateRamPolicyExportTaskAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateRamPolicyExportTaskAttributeResponse
 */
async function updateRamPolicyExportTaskAttributeWithOptions(ramPolicyExportTaskId: string, request: UpdateRamPolicyExportTaskAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateRamPolicyExportTaskAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.authorizationAccountIds)) {
    body['authorizationAccountIds'] = request.authorizationAccountIds;
  }
  if (!$isNull(request.authorizationActions)) {
    body['authorizationActions'] = request.authorizationActions;
  }
  if (!$isNull(request.authorizationRegionIds)) {
    body['authorizationRegionIds'] = request.authorizationRegionIds;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.triggerStrategy)) {
    body['triggerStrategy'] = request.triggerStrategy;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateRamPolicyExportTaskAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/ramPolicyExportTasks/${$URL.percentEncode(ramPolicyExportTaskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改RAM策略导出任务
 *
 * @param request UpdateRamPolicyExportTaskAttributeRequest
 * @return UpdateRamPolicyExportTaskAttributeResponse
 */
async function updateRamPolicyExportTaskAttribute(ramPolicyExportTaskId: string, request: UpdateRamPolicyExportTaskAttributeRequest): UpdateRamPolicyExportTaskAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateRamPolicyExportTaskAttributeWithOptions(ramPolicyExportTaskId, request, headers, runtime);
}

model UpdateResourceExportTaskAttributeRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.'),
  configPath?: string(name='configPath'),
  description?: string(name='description'),
  excludeRules?: [ 
    {
      key?: string(name='key'),
      values?: [ string ](name='values'),
    }
  ](name='excludeRules'),
  exportToModule?: {
    source?: string(name='source'),
    sourcePath?: string(name='sourcePath'),
    statePath?: string(name='statePath'),
  }(name='exportToModule'),
  includeRules?: [ 
    {
      key?: string(name='key'),
      values?: [ string ](name='values'),
    }
  ](name='includeRules'),
  name?: string(name='name', description='This parameter is required.'),
  ramRole?: string(name='ramRole'),
  terraformProviderVersion?: string(name='terraformProviderVersion'),
  terraformVersion?: string(name='terraformVersion'),
  triggerStrategy?: string(name='triggerStrategy'),
  variables?: [ 
    {
      properties?: [ string ](name='properties'),
      resourceType?: string(name='resourceType'),
    }
  ](name='variables'),
}

model UpdateResourceExportTaskAttributeResponseBody = {
  exportTaskId?: string(name='exportTaskId'),
  exportVersion?: string(name='exportVersion'),
  requestId?: string(name='requestId'),
}

model UpdateResourceExportTaskAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResourceExportTaskAttributeResponseBody(name='body'),
}

/**
 * @summary 更新导出任务
 *
 * @param request UpdateResourceExportTaskAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResourceExportTaskAttributeResponse
 */
async function updateResourceExportTaskAttributeWithOptions(exportTaskId: string, request: UpdateResourceExportTaskAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateResourceExportTaskAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.configPath)) {
    body['configPath'] = request.configPath;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.excludeRules)) {
    body['excludeRules'] = request.excludeRules;
  }
  if (!$isNull(request.exportToModule)) {
    body['exportToModule'] = request.exportToModule;
  }
  if (!$isNull(request.includeRules)) {
    body['includeRules'] = request.includeRules;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.terraformProviderVersion)) {
    body['terraformProviderVersion'] = request.terraformProviderVersion;
  }
  if (!$isNull(request.terraformVersion)) {
    body['terraformVersion'] = request.terraformVersion;
  }
  if (!$isNull(request.triggerStrategy)) {
    body['triggerStrategy'] = request.triggerStrategy;
  }
  if (!$isNull(request.variables)) {
    body['variables'] = request.variables;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateResourceExportTaskAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/exportTasks/${$URL.percentEncode(exportTaskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新导出任务
 *
 * @param request UpdateResourceExportTaskAttributeRequest
 * @return UpdateResourceExportTaskAttributeResponse
 */
async function updateResourceExportTaskAttribute(exportTaskId: string, request: UpdateResourceExportTaskAttributeRequest): UpdateResourceExportTaskAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateResourceExportTaskAttributeWithOptions(exportTaskId, request, headers, runtime);
}

model UpdateTaskAttributeRequest {
  autoApply?: boolean(name='autoApply', description='This parameter is required.', example='true'),
  autoDestroy?: boolean(name='autoDestroy', example='true'),
  description?: string(name='description', example='demo'),
  groupInfo?: {
    groupId?: string(name='groupId', example='g-433aead7560571e66e31274ffd3'),
    projectId?: string(name='projectId', example='p-433aead75605713865c386cb9d'),
  }(name='groupInfo'),
  initModuleState?: boolean(name='initModuleState'),
  moduleId?: string(name='moduleId', description='This parameter is required.', example='mod-148e7853433574fff6b316f4eb737e'),
  moduleVersion?: string(name='moduleVersion', description='This parameter is required.', example='v1'),
  name?: string(name='name', description='This parameter is required.', example='test'),
  parameters?: map[string]string(name='parameters'),
  protectionStrategy?: [ string ](name='protectionStrategy'),
  ramRole?: string(name='ramRole', description='This parameter is required.', example='{}'),
  skipPropertyValidation?: boolean(name='skipPropertyValidation'),
  terraformVersion?: string(name='terraformVersion', example='1.2.6'),
  triggerStrategy?: string(name='triggerStrategy', description='This parameter is required.', example='Manual'),
  triggerValue?: string(name='triggerValue', example='******'),
}

model UpdateTaskAttributeResponseBody = {
  requestId?: string(name='requestId', example='17793D91-A26F-520D-A948-3452A45D15B1'),
}

model UpdateTaskAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTaskAttributeResponseBody(name='body'),
}

/**
 * @summary 修改任务
 *
 * @param request UpdateTaskAttributeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTaskAttributeResponse
 */
async function updateTaskAttributeWithOptions(taskId: string, request: UpdateTaskAttributeRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateTaskAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.autoApply)) {
    body['autoApply'] = request.autoApply;
  }
  if (!$isNull(request.autoDestroy)) {
    body['autoDestroy'] = request.autoDestroy;
  }
  if (!$isNull(request.description)) {
    body['description'] = request.description;
  }
  if (!$isNull(request.groupInfo)) {
    body['groupInfo'] = request.groupInfo;
  }
  if (!$isNull(request.initModuleState)) {
    body['initModuleState'] = request.initModuleState;
  }
  if (!$isNull(request.moduleId)) {
    body['moduleId'] = request.moduleId;
  }
  if (!$isNull(request.moduleVersion)) {
    body['moduleVersion'] = request.moduleVersion;
  }
  if (!$isNull(request.name)) {
    body['name'] = request.name;
  }
  if (!$isNull(request.parameters)) {
    body['parameters'] = request.parameters;
  }
  if (!$isNull(request.protectionStrategy)) {
    body['protectionStrategy'] = request.protectionStrategy;
  }
  if (!$isNull(request.ramRole)) {
    body['ramRole'] = request.ramRole;
  }
  if (!$isNull(request.skipPropertyValidation)) {
    body['skipPropertyValidation'] = request.skipPropertyValidation;
  }
  if (!$isNull(request.terraformVersion)) {
    body['terraformVersion'] = request.terraformVersion;
  }
  if (!$isNull(request.triggerStrategy)) {
    body['triggerStrategy'] = request.triggerStrategy;
  }
  if (!$isNull(request.triggerValue)) {
    body['triggerValue'] = request.triggerValue;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateTaskAttribute',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/tasks/${$URL.percentEncode(taskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改任务
 *
 * @param request UpdateTaskAttributeRequest
 * @return UpdateTaskAttributeResponse
 */
async function updateTaskAttribute(taskId: string, request: UpdateTaskAttributeRequest): UpdateTaskAttributeResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTaskAttributeWithOptions(taskId, request, headers, runtime);
}

model UpdateTaskPolicyRequest {
  clientToken?: string(name='clientToken', description='This parameter is required.', example='a65451293e64979ba7a4b573950217fe'),
  taskPolicies?: [ 
    {
      priority?: string(name='priority', example='5'),
      taskId?: string(name='taskId', example='task-60f24b4eb47f1135b7b14ddbdfd'),
      type?: string(name='type', example='SceneTestingTask'),
    }
  ](name='taskPolicies'),
}

model UpdateTaskPolicyResponseBody = {
  requestId?: string(name='requestId', example='0D797DC3-FF04-5C21-81EB-92C7799512E3'),
}

model UpdateTaskPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTaskPolicyResponseBody(name='body'),
}

/**
 * @summary 修改分组优先级配置
 *
 * @param request UpdateTaskPolicyRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTaskPolicyResponse
 */
async function updateTaskPolicyWithOptions(groupId: string, request: UpdateTaskPolicyRequest, headers: map[string]string, runtime: $RuntimeOptions): UpdateTaskPolicyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['clientToken'] = request.clientToken;
  }
  if (!$isNull(request.taskPolicies)) {
    body['taskPolicies'] = request.taskPolicies;
  }

  var req = new OpenApiUtil.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateTaskPolicy',
    version = '2021-08-06',
    protocol = 'HTTPS',
    pathname = `/group/task/policy/${$URL.percentEncode(groupId)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改分组优先级配置
 *
 * @param request UpdateTaskPolicyRequest
 * @return UpdateTaskPolicyResponse
 */
async function updateTaskPolicy(groupId: string, request: UpdateTaskPolicyRequest): UpdateTaskPolicyResponse {
  var runtime = new $RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTaskPolicyWithOptions(groupId, request, headers, runtime);
}

